Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在IE8上将宽度设置为_Css_Internet Explorer 8 - Fatal编程技术网

Css 在IE8上将宽度设置为

Css 在IE8上将宽度设置为,css,internet-explorer-8,Css,Internet Explorer 8,是否可以将宽度设置为选项?我尝试了很多方法,但到目前为止,什么都没有: 只有在IE上我才有这个问题。已经尝试过这个: jQuery: $( "select" ).toggle( function() { $( "option" ).animate({ width: 500 }, 1000 ); }, function() { $( "option" ).animate({ width: 240 }, 1000 ); } ); -其他jQuery- $("select") .mouseover(

是否可以将宽度设置为选项?我尝试了很多方法,但到目前为止,什么都没有: 只有在IE上我才有这个问题。已经尝试过这个:

jQuery:

$( "select" ).toggle(
function() {
$( "option" ).animate({
width: 500
}, 1000 );
},
function() {
$( "option" ).animate({
width: 240
}, 1000 );
}
);
-其他jQuery-

$("select")
.mouseover(function(){
$(this)
.data("origWidth", $(this).css("width"))
.css("width", "auto");
})
.mouseout(function(){
$(this).css("width", $(this).data("origWidth"));
});
-css-

option{
width:auto;
}
-除IE外,所有浏览器都能完美运行-

如果有人能帮我解决这个问题,我将非常感激

检查小提琴示例:

尝试选项{display:block;}。如果需要对齐选项{float:left;}