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
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. . . .
What about the option closing tag?
Don’t make a fuss,
What about the option closing tag?
[selected=selected]{color:red;}
selected=selectedLower 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! ! !