Compatible with min-width, min-height, and ie6minheight of IE6

Source: Internet
Author: User

Compatible with min-width, min-height, and ie6minheight of IE6

If a site is wide-screen, you can drag the browser's window to the left and right. The website width will change with the window size. When the browser's window width is reduced to a certain extent, the following scroll bar will appear, the website width will not be reduced. We know that this simple function can be implemented easily with the min-width of css, but unfortunately, many of our IE6 users do not support this very convenient attribute. What should we do? We only need to add the following css statement to the webpage design:

Method 1:

height:auto!important;height:580px;min-height:580px;

Add the above three lines of code to the div with the minimum width. The principle is to use IE6's own BUG (when something inside the block-level element exceeds the height of the block-level element, the height of block-level elements is extended, that is, the height attribute in IE6 is equivalent to min-height ).

Method 2:

min-height:200px;_height:200px;

Method 3:

#min-width{    min-width:900px;    _width:expression((document.documentElement.clientWidth||document.body.clientWidth)<900?"900px":"");    line-height:200px;    background:#ccc;}

Method 4:

#mpage{    width:100%;    min-width:980px;    position:relative;    _width: expression(((document.compatMode && document.compatMode=='CSS1Compat')? document.documentElement.clientWidth : document.body.clientWidth) < 980? '980px' : 'auto'); }

 

 

Either of the four methods can solve the problem that IE6 does not support the min-width attribute. This site uses the fourth method.

 

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.