A simple method to be compatible with IE6's min-width and min-height

A simple method to be compatible with IE6's min-width and min-height

If a website is widescreen, you drag the browser window left and right and the website width will change with the size of the window. When the browser window width is reduced to a certain extent, a scroll bar will appear below and the website width will not be reduced any further. We know that this simple function can be easily achieved using CSS min-width, but unfortunately, many of our users' IE6 does not support this very convenient attribute. What can we do? We can solve this problem by adding the following CSS statement when designing the web page:

Method 1:

CSS CodeCopy content to clipboard
  1. height : auto ! important ;
  2. height : 580px ;
  3. min-height : 580px ;

Just add the above three lines of code to the div that requires a minimum width. The principle is to use the BUG of IE6 itself (when the content inside a block-level element exceeds the height of this block-level element, the height of the block-level element will be stretched, that is, the height attribute in IE6 itself is equivalent to min-height).

Method 2:

CSS CodeCopy content to clipboard
  1. min-height : 200px ;
  2. _height: 200px ;

Method 3:

CSS CodeCopy content to clipboard
  1. #min -width{
  2.      min-width : 900px ;
  3. _width:expression((document.documentElement.clientWidth||document.body.clientWidth)<900? "900px" : "" );
  4.      line-height : 200px ;
  5.      background : #ccc ;
  6. }

Method 4:

CSS CodeCopy content to clipboard
  1. #mpage {
  2.      width :100%;
  3.      min-width : 980px ;
  4.      position : relative ;
  5. _width: expression(((document.compatMode && document.compatMode== 'CSS1Compat' )? document.documentElement.clientWidth : document.body.clientWidth) < 980? '980px' : 'auto' );
  6. }

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

The above simple method of min-width and min-height compatible with IE6 is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

<<:  Introduction to fourteen cases of SQL database

>>:  CSS3 click button circular progress tick effect implementation code

Recommend

Summary of Vue's monitoring of keyboard events

Key Modifiers When listening for keyboard events,...

Method and introduction of table index definition in MySQL

Overview An index is a table of correspondence be...

HTML tags: sub tag and sup tag

Today I will introduce two HTML tags that I don’t...

Nginx sample code for implementing dynamic and static separation

In combination with the scenario in this article,...

Example code for implementing verification code login in SMS API in Node

1. Node server setup + database connection The op...

Implementation of CSS equal division of parent container (perfect thirds)

The width of the parent container is fixed. In or...

Detailed explanation of the installation steps of the MySQL decompressed version

1. Go to the official website: D:\mysql-5.7.21-wi...

MySQL database master-slave replication and read-write separation

Table of contents 1. Master-slave replication Mas...

How to create dynamic QML objects in JavaScript

1. Dynamically create objects There are two ways ...

MySQL index coverage example analysis

This article describes MySQL index coverage with ...

SQL implements LeetCode (180. Continuous numbers)

[LeetCode] 180. Consecutive Numbers Write a SQL q...

What command is better for fuzzy searching files in Linux?

1. Introduction This article mainly explains how ...

Detailed example of creating and deleting tables in MySQL

The table creation command requires: The name of...