How to not wrap contents of a div?

前端 未结 6 838
情歌与酒
情歌与酒 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条回答
  •  Happy的楠姐
    2020-12-22 22:07

    If you don't care about a minimum width for the div and really just don't want the div to expand across the whole container, you can float it left -- floated divs by default expand to support their contents, like so:

提交回复
热议问题