How to set the minimum value of the Css style Div Row Height

Source: Internet
Author: User

In IE6, when CSS is used to define the height of a DIV, this problem often occurs when the minimum height of the DIV is smaller than a certain value, no matter how you set the minimum height, the height of the Div will be fixed at a value and will not change. This problem is very annoying. This is because in IE6, the system does not default that Div has a default height, but you have not solved a hidden parameter, font-size, in ie6, the font-size in the Div attribute is closely related to the font-size defined in your system css. Therefore, you must define the font-size of this Div separately, in this way, the problem can be solved.

This problem occurs in IE6. The div in IE6 has the smallest font height by default, and the smallest div height is the height, unless you change the font size. Add:

. Style1 {height: 1px; font-size: 0 ;}

For example, you want to use a div to create a red line with a height of 1 px.

When the font size is not set, the height is not as expected.

Reference content is as follows:
</Style>
<Div class = "style1"> </div>
<Style type = "text/css">
. Style1 {
Height: 1px;
Background: red;
}
</Style>
<Div class = "style1"> </div>

If font-size: 0 is set, the result is that the row height is changed to the specified 1px. The Code is as follows:

Reference content is as follows:
<Style type = "text/css">
. Style1 {
Font-size: 0;
Height: 1px;
Background: red;
}
</Style>
<Div class = "style1"> </div>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.