Css div cannot cover select solution

Source: Internet
Author: User

So how can we solve this bug? The solution to this bug is as follows:

1. Place select in iframe. div cannot overwrite select, but iframe can overwrite select, while div can overwrite iframe. So the solution is to use the Iframe element with a higher Z axis height, wrap or overwrite the drop-down list box control to bring it back to the normal Z axis height, but every select is too annoying, not recommended

2. Place an empty iframe in the div whose select needs to be overwritten, so that the problem can be solved in a targeted manner, which is simple and recommended.

The following code shows the css tutorial for the 2nd methods:

 

<STYLE type = text/css>

# Pop {

Width: 300px;

Height: 100px;

Padding: 10px;

Position: absolute;

Top: 0;

Border: 1px solid blue;

Background-color: # 6666CC;

Filter: alpha (opacity = 70 );

Opacity: 0.6;

}

# Sect {

Width: 400px;

Margin-top: 60px

}

# Pop iframe {

Display: none;

Display: block;

Position: absolute;

Top: 0;

Left: 0;

Z-index:-1;

Width: 3000px;

Height: 3000px;

}

</STYLE>


The html code is as follows:

<DIV id = pop> This is an absolutely positioned div. Check whether it blocks select. <IFRAME> </DIV>
<SELECT id = sect> <OPTION value = 1 selected> I'm select. Can you cover me? </OPTION> <OPTION value = 2> I'm select, can you cover me? </OPTION> </SELECT>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.