overflow:hidden ignoring bottom padding

后端 未结 10 2259
北海茫月
北海茫月 2020-12-14 15:50

In the following example, the bottom padding is ignored, and the text flows to the bottom of the element before hiding. What is causing this?

10条回答
  •  天涯浪人
    2020-12-14 16:44

    The bottom padding exists but the content pushes the bottom padding down and is not visible because of overflow:hidden. What you can do is place the content in a container like so:

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    Hello, this is text.

    You can play with the fiddle here - http://jsfiddle.net/BMZeS/

    Hope this helps.

提交回复
热议问题