IE6 implements min-width

IE6 implements min-width

First of all, we know that this effect should be an old topic.
When I was organizing files today, I found that some of my previous layout solutions had been lying in folders for a long time. I dug up some old stuff. It should be noted that I was fortunate enough to see the old engineer and webmaster of CSSPLAY implement this effect, and it must have been given very early.
Without further ado, here is the source code:
Trigger and utilize the weird features of IE6-layout, CSS implementation:
<style type="text/css">
.ie6-out{
_margin-left:900px;
_zoom:1;
}
.ie6-in{
_position:relative;
_float:left;
_margin-left:-900px;
}
#min-width{
min-width:900px;
background:#ccc;
line-height:200px;
_zoom:1;
}
</style>
<div class="ie6-out">
<div class="ie6-in">
<div id="min-width">Under ie6, the container simulates the min-width effect. Please resize your browser window as desired and click the "View Width" button. </div>
</div>
</div>
CSS implementation demonstration:
Run code box

[Ctrl A Select All Tip: You can modify part of the code first, then press Run]
Extended Demo:
Run code box

[Ctrl A Select All Tip: You can modify part of the code first, then press Run]
CSS Expression
——I believe that many people are often troubled by inexplicable crashes when using this method to achieve the minimum width of the container, and often end up in vain.
There are two points that need to be pointed out here:
1. The element representing the viewport in IE6-standard mode and quirk mode is different, the former is <html>, and the latter is <body>;
2. IE6- In the above two different modes, it has different manifestations when the contained content overflows, which leads to an infinite loop in the assignment judgment. This may sound a bit long-winded, so just practice it yourself.
CSS Expression to achieve minimum width source code: <style type="text/css">
body{ text-align:center;}
#min-width{
min-width:900px;
_width:expression((document.documentElement.clientWidth||document.body.clientWidth)<900?"900px":"");
line-height:200px;
background:#ccc;
}
</style>
<div id="min-width">Under ie6, the container simulates the min-width effect. Please resize your browser window as desired and click the "View Width" button. </div>
Demo:
Run code box

[Ctrl A Select All Tip: You can modify part of the code first, then press Run]
The above two solutions can be implemented in both IE6-standard mode and quirk mode. IE Expression also did not find any CPU efficiency issues in this application.

<<:  Several ways to change MySQL password

>>:  Docker starts Redis and sets the password

Recommend

Summary of ten Linux command aliases that can improve efficiency

Preface Engineers working in the Linux environmen...

Detailed explanation of the middleman mode of Angular components

Table of contents 1. Middleman Model 2. Examples ...

Detailed explanation of MySQL deadlock and database and table sharding issues

Record the problem points of MySQL production. Bu...

js implements random roll call

This article shares the specific code of js to im...

Detailed explanation of MySQL 5.7.9 shutdown syntax example

mysql-5.7.9 finally provides shutdown syntax: Pre...

A simple example of creating a thin line table in html

Regarding how to create this thin-line table, a s...

Detailed explanation of chmod command usage in Linux

chmod Command Syntax This is the correct syntax w...

W3C Tutorial (1): Understanding W3C

W3C, an organization founded in 1994, aims to unl...

How to solve the error of connecting to the database when ServerManager starts

Servermanager startup connection database error R...

How to implement import and export mysql database commands under linux

1. Export the database using the mysqldump comman...

Detailed installation process of MySQL 8.0 Windows zip package version

The installation process of MySQL 8.0 Windows zip...

Detailed process of installing various software in Docker under Windows

1. Install MySQL # Download mysql in docker docke...