Firefox unexpected line break using floats & overflow hidden

后端 未结 4 971
别那么骄傲
别那么骄傲 2020-12-16 14:55

I have a container div that holds two items: a .button and a .box with text inside. .button comes first and is floated right. .b

相关标签:
4条回答
  • 2020-12-16 15:40

    white-space: normal didn't do the trick for me. What worked was white-space: nowrap; on the direct text container.

    0 讨论(0)
  • 2020-12-16 15:48

    Add display: inline-block; to .box:

    Demo

    0 讨论(0)
  • 2020-12-16 15:57

    I came across this issue today where the floating node would break line only in Firefox even after setting its display to inline-block and the reason for that was that the container node had a style setting of white-space set to nowrap. So resetting the value of white-space to normal on the container node resolved this issue for me.

    0 讨论(0)
  • 2020-12-16 15:59

    Actually, when you are going for a solution like http://jsfiddle.net/Volker_E/x5rPd/ you don't need a second div for your desired behavior.

    0 讨论(0)
提交回复
热议问题