Home > Web Front-end > CSS Tutorial > How to set the minimum height of css in firefox and IE6

How to set the minimum height of css in firefox and IE6

不言
Release: 2018-06-28 14:35:41
Original
2224 people have browsed it

This article mainly introduces how to set the minimum height of css in firefox and IE6. It has certain reference value. Now I share it with you. Friends in need can refer to it

In web page layout You will encounter the problem of setting the minimum height of CSS in Firefox and IE6. This article will provide a solution. Friends who need to know more can refer to

IE6 does not support min-height in CSS, so IE6 needs to be set separately. Setting, height will automatically expand in IE6 even if it exceeds the fixed height. This problem is very confusing

#main{      
    min-height:320px; //用于firefox 
    _height:320px; //用于IE6 
}
Copy after login

When setting the minimum height of a certain area to a certain value , the performance is different in Firefox, IE6 and IE7. If you only set the min-height value, it will not be recognized in IE6; but if you set the height value, the position will be fixed in IE7 and Firefox. This is a big problem. So in order to coordinate various browsers and various versions, how can we solve the minimum height problem?

I searched for some relevant information on the Internet, and there is a better solution:

.distance { 
height:auto!important; 
height:100px; 
min-height:100px; 
}
Copy after login

! The import (priority) tag is not recognized in IE6, so the above code will be Is understood to be:

height:100px; 
min-height:100px;
Copy after login

And in IE7 it is:

height:auto; 
min-height:100px;
Copy after login

Here, the features we use are:
IE6 cannot recognize the !important tag;
IE6 cannot Identify the min-height tag;
The final effect of the height tag in IE6 is equivalent to the minimum height (min-height) tag in IE7 and Firefox browsers;
The above problem can eventually be solved.

Another method: (I can’t understand this, but it can be used)

.autoheight{ min-height:200px; height:200px;} 
[class].autoheight{height:auto;}
Copy after login

The above is the entire content of this article. I hope it will be helpful to everyone’s learning. For more related content, please pay attention to PHP Chinese website!

Related recommendations:

Four code settings for CSS to implement web page background gradient

How to solve the problem of direct access after webpack packaging Page image path error

#

The above is the detailed content of How to set the minimum height of css in firefox and IE6. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template