Tips for using DIV container fixed height in IE6 and IE7

Tips for using DIV container fixed height in IE6 and IE7
There are many differences between IE6 and IE7 in their interpretation of CSS. Today we will talk about one of them: height.
example:
Copy code
The code is as follows:
<div style="height:50px">


Under IE6: If the content height in the DIV does not exceed 50px, the height of the DIV is 50px. If it exceeds the set value, the height will expand with the content, which is usually called adaptive height.
Under IE7: If the height of the content in the DIV does not exceed 50px, the height of the DIV is 50px. If it exceeds the set value, the height of the DIV will still be fixed at 50px, and the excess content will exceed the DIV and overflow. If there is other content under the DIV, it will overlap with the overflowing content.

This is obviously a very important point, if not handled it will cause page disorder. There are usually two ways to solve this problem:

1. Focus on height: fix the height of DIV to 50px, hide the extra content, and write the CSS for both browsers as follows:
Copy code
The code is as follows:
<div style="height:50px;overflow:hidden">
overflow:hidden is very important, compatibility depends on it

2. Content-oriented: Set the minimum DIV height to 50px. When there is too much content, the DIV height will adapt to the content. At this time, CSS HACK is needed to do some compatibility processing:
<div style="min-height:50px;_height:50px;">, min-height:50px minimum height, this IE7 and FF can recognize, _height:50px is underlined for the purpose of only allowing IE6 to recognize it.

<<:  Use CSS to achieve three-column adaptive layout (fixed width on both sides, adaptive in the middle)

>>:  The latest Linux installation process of tomcat8

Recommend

HTML special character conversion table

character Decimal Character Number Entity Name --...

Specific method of viewing user authorization information in mysql

Specific method: 1. Open Command Prompt 2. Enter ...

Detailed explanation of fs module and Path module methods in Node.js

Overview: The filesystem module is a simple wrapp...

Summary of some common methods of JavaScript array

Table of contents 1. How to create an array in Ja...

How to completely uninstall mysql under CentOS

This article records the complete uninstallation ...

WeChat applet implements countdown for sending SMS verification code

This article shares the specific code for the WeC...

5 Easy Ways to Free Up Space on Ubuntu

Preface Most people will probably perform this op...

TinyEditor is a simple and easy-to-use HTML WYSIWYG editor

A few days ago, I introduced to you a domestic xh...

MySQL scheduled backup solution (using Linux crontab)

Preface Although some love in this world has a pr...

Detailed explanation of how to use the Vue license plate search component

A simple license plate input component (vue) for ...

When the interviewer asked the difference between char and varchar in mysql

Table of contents Difference between char and var...

Detailed explanation of Json format

Table of contents A JSON is built on two structur...

Responsive layout summary (recommended)

Basic knowledge of responsive layout development ...

HTML iframe usage summary collection

Detailed Analysis of Iframe Usage <iframe frame...