How to not wrap contents of a div?

前端 未结 6 865
情歌与酒
情歌与酒 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:12

    I don't know the reasoning behind this, but I set my parent container to display:flex and the child containers to display:inline-block and they stayed inline despite the combined width of the children exceeding the parent.

    Didn't need to toy with max-width, max-height, white-space, or anything else.

    Hope that helps someone.

提交回复
热议问题