Solution for IE6 with a height less than 1-10 pixels

Source: Internet
Author: User

DIV is often used in Webpage layout to display some corner backgrounds. You need to set a smaller height. By default, setting a lower Div height in IE6 does not work, this problem does not exist in IE 7, FF and other browsers.

In IE6, the default font size is roughly 12-14px. When you try to define a div with a height smaller than this default value, IE6 will stubbornly think that the height of this layer should not be smaller than the Row Height of the font. So even if you use Height: 5px; to define the height of a DIV, the actual layer displayed in IE6 is a layer with a height of around 12px.

To solve this problem, you can define the font size of the DIV, or define the overflow attribute to limit the automatic adjustment of the DIV height. For example:

<Div style = "height: 5px; Font: 0px Arial; line-Height: 0;"> </div>

Or:

<Div style = "height: 5px; overflow: hidden;"> </div>

It is worth noting that when font-size: 0 is set, the minimum height of the container is 2px. To set the DIV height to 0 or 1px, use overflow: hidden.

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.