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

Detailed explanation of the difference between run/cmd/entrypoint in docker

In Dockerfile, run, cmd, and entrypoint can all b...

MySQL full-text fuzzy search MATCH AGAINST method example

MySQL 4.x and above provide full-text search supp...

...

Detailed tutorial on installing Python 3.6.6 from scratch on CentOS 7.5

ps: The environment is as the title Install possi...

How to adapt CSS to iPhone full screen

1. Media query method /*iPhone X adaptation*/ @me...

Methods and techniques for designing an interesting website (picture)

Have you ever encountered a situation where we hav...

HTML6 implements folding menu and accordion menu example code

The main part of the page: <body> <ul id...

Page Refactoring Skills - Content

Enough of small talk <br />Based on the lar...

How to use the yum command

1. Introduction to yum Yum (full name Yellow dogU...

MySQL 5.7.13 installation and configuration method graphic tutorial on Mac

MySQL 5.7.13 installation tutorial for Mac, very ...

Solution to win10 without Hyper-V

Are you still looking for a way to enable Hyper-v...

Basic application methods of javascript embedded and external links

Table of contents Basic application of javascript...

Web2.0: Causes and Solutions of Information Overload

<br />Information duplication, information o...