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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 11:42:101244browse

Same code
14270eeb917b9c0865f33d36f514ce27
                                                                                                 
18bb6ffaf0152bbe49cd8a3620346341

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;}

selected=selected
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>

<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>
Oh my God! ! !

Statement:
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