Usually when we lay out the web page, there is always a problem with too much text content, which exceeds the height that exceeds our limit. Then there will be somepicturesthat will break the DIV and make the web page misaligned and confusing. Then How do we solve this?
We need to solve how to use CSS to automatically hide content that exceeds the set CSS width and CSS height without breaking the DIV layout.
Especially in IE6, if the content exceeds the height and width of theobject, it will be burst and increased in height. At this time, we can use the following solutions.
Solution to CSS style
At this time we can use CSSoverflowStyle solution:
Corresponding style overflow:hidden
Div{ overflow:hidden}
After setting like this, if the DIV object is set to a certain width and height, adding overflow:hidden at this time will hide the content including pictures that exceeds the width and height of the DIV.
Related reading: css implements overflow and exceeds the text content to display ellipses
Hide the excess content case
1. Hide the text content that exceeds the width and height of the object
If we In order to align the object beautifully in a layout, sometimes we need to set the height and width of the object and then fix it. At this time, we need to realize that no matter how much content and text there is, the layout should not exceed the set width and height. At this time, we need the help of overflow:hidden.
CSS code:
Html code:
欢迎,Copy after loginHere you can learn CSS and download the resources you need,
At the same time you can find yourselfFAQAnswer
Solution to broken content
Set overflow:hidden in this way, no matter how much content there is, the object will be hidden. The width and height are set so that they cannot fit outside. Content.
Here, set an object box with a certain CSS width and CSS height, place a large picture, and then use overflow:hidden to hide the excess part.
Css code
Html code
So, if you want the content to not exceed the width and height limit set by the object, then use overflow:hidden to hide the excess part. .
There are so many overflow hidden tips, please pay attention to php Chinese website for more excitingOtherrelated articles!
Related reading:
##How to use HTML5