Home > Web Front-end > HTML Tutorial > About the problem that the difference between IE11 and IE9 makes css difficult to use_html/css_WEB-ITnose

About the problem that the difference between IE11 and IE9 makes css difficult to use_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:42:10
Original
1197 people have browsed it

Same code


The code in style works well in IE9, but does not work in IE11. The displayed font is still black

Please help me. . . .


Reply to discussion (solution)

Don’t make a fuss,

What about the option closing tag?

There is another way! important is written in a way that has higher weight than inline.

Don’t make a fuss,

What about the option closing tag?

I just pasted part of the code and it works fine in IE9
What I want to achieve is that if 222222 is selected in the drop-down box, the font in the drop-down box will be displayed in red

[selected=selected]{color:red;}
Copy after login

selected=selected
Copy after login
Lower version of IE cannot Fully supports CSS2.(IE67)

<select id="myselect" style="color:red">      <option style="color:black" value="1">1111</option>      <option style="color:red" selected value="2">2222222</option></select><script type="text/javascript">document.getElementById("myselect").onchange = function(){	this.style.color = this.options[this.selectedIndex].style.color;}</script>
Copy after login
Copy after login

<select id="myselect" style="color:red">      <option style="color:black" value="1">1111</option>      <option style="color:red" selected value="2">2222222</option></select><script type="text/javascript">document.getElementById("myselect").onchange = function(){	this.style.color = this.options[this.selectedIndex].style.color;}</script>
Copy after login
Copy after login
Oh my God! ! !

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template