同样的代码
style中的代码在IE9中好使,在IE11中就不起作用,显示的字体还是黑色的
求大神帮忙。。。。
不要大惊小怪的,
option 闭合标签呢?
另外还有种!important写法,比内联权重要高的.
不要大惊小怪的,
option 闭合标签呢?
[selected=selected]{color:red;}
selected=selected
<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>
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号