Solution to the bug that IE6 select cannot be covered by div

Solution to the bug that IE6 select cannot be covered by div
Use div to create a mask or simulate a pop-up window. However, in IE6, when there is a drop-down list box select element under the div, the drop-down list box will break through the div and be displayed on the div. This problem will occur regardless of the z-index value. The problem may be due to the pop-up drop-down list of the drop-down list control, which causes the Z-axis height to be out of control. But IE6 has a magical logic, div cannot cover select, but iframe can cover select, and div can cover iframe, so the solution is to use an Iframe element with a higher Z-axis height to wrap or cover the drop-down list box control to return it to its normal Z-axis height!

The html is as follows:
Html code

Copy code
The code is as follows:

<div id="acontainnerbox" class="aboxinitcss">
Here are a lot of codes,
<iframe class="ifhideselect" frameborder="0"></iframe>
</div>


Copy code
The code is as follows:

<div id="acontainnerbox" class="aboxinitcss">
Here are a lot of codes,
<iframe class="ifhideselect" frameborder="0"></iframe>
</div>


The css code is as follows:
Html code

Copy code
The code is as follows:

.aboxinitcss{
position:absolute;
margin-top:0px;
margin-left:0px;
display:none;
background:#FFF;
border:solid #CCC 1px;
padding:30px;
z-index:9999;
width:620px;overflow:hidden;
}
.ifhideselect{
z-index:-1;
width:680px;
height:255px;
position:absolute;
border:0;
left:0;
top:0;
}
.aboxinitcss{
position:absolute;
margin-top:0px;
margin-left:0px;
display:none;
background:#FFF;
border:solid #CCC 1px;
padding:30px;
z-index:9999;
width:620px;overflow:hidden;
}
.ifhideselect{
z-index:-1;
width:680px;
height:255px;
position:absolute;
border:0;
left:0;
top:0;
}

This will solve this bug.
The z-index of the iframe must be set to a negative number, otherwise it will not be covered.

<<:  Specific use of stacking context in CSS

>>:  An article to give you a deep understanding of Mysql triggers

Recommend

Experience in solving tomcat memory overflow problem

Some time ago, I submitted a product version to t...

Detailed explanation of log processing of Docker containers

Docker has many log plug-ins. The default is to u...

CSS XTHML writing standards and common problems summary (page optimization)

Project Documentation Directory Div+CSS Naming Sta...

How to use React slots

Table of contents need Core Idea Two ways to impl...

Use CSS3 to implement button hover flash dynamic special effects code

We have introduced how to create a waterfall layo...

Description of meta viewport attribute in HTML web page

HTML meta viewport attribute description What is ...

Summary of 7 pitfalls when using react

Table of contents 1. Component bloat 2. Change th...

Use JS to zoom in and out when you put the mouse on the image

Use JS to zoom in and out when the mouse is on th...

33 ice and snow fonts recommended for download (personal and commercial)

01 Winter Flakes (Individual only) 02 Snowtop Cap...

JavaScript to implement the function of changing avatar

This article shares the specific code of JavaScri...

A brief discussion on several ways to pass parameters in react routing

The first parameter passing method is dynamic rou...

CSS realizes process navigation effect (three methods)

CSS realizes the process navigation effect. The s...

Vue implements login type switching

This article example shares the specific code of ...

Detailed explanation of SSH password-free login configuration under Linux

Assume there are two Linux servers A and B, and w...

Introduction to Enterprise Production MySQL Optimization

Compared with other large databases such as Oracl...