How to not wrap contents of a div?

前端 未结 6 868
情歌与酒
情歌与酒 2020-12-22 21:33

I\'ve got a fixed-width div with two buttons in it. If the labels of the buttons are too long, they wrap – one button stays on the first line, and the nex

6条回答
  •  忘掉有多难
    2020-12-22 22:14

    If your div has a fixed-width it shouldn't expand, because you've fixed its width. However, modern browsers support a min-width CSS property.

    You can emulate the min-width property in old IE browsers by using CSS expressions or by using auto width and having a spacer object in the container. This solution isn't elegant but may do the trick:

提交回复
热议问题