Javascript FF、Chrome和所有IE之间的LI宽度不一致
我有9个项目的导航菜单,最上面的结构如下:Javascript FF、Chrome和所有IE之间的LI宽度不一致,javascript,jquery,css,css-reset,Javascript,Jquery,Css,Css Reset,我有9个项目的导航菜单,最上面的结构如下: UL LI A 我正在重置文本渲染: #horizontalMega2 > li > a { font-family: "Helvetica", "Arial", "Verdana", "sans-serif"; font-size:10px; font-weight: normal; letter-spacing: normal; white-space: nowrap; word-spa
UL LI A
我正在重置文本渲染:
#horizontalMega2 > li > a {
font-family: "Helvetica", "Arial", "Verdana", "sans-serif";
font-size:10px;
font-weight: normal;
letter-spacing: normal;
white-space: nowrap;
word-spacing: normal;
text-transform: uppercase;
width:100%;
}
使用jQuery在其上循环时:
$( '#horizontalMega2 > li').each( function(){
console.log( 'outerWidth( true ) ' + $(this).outerWidth( true ));
}
。。。控制台显示在
FF
outerWidth( true ) 61
outerWidth( true ) 59
outerWidth( true ) 39
outerWidth( true ) 50
outerWidth( true ) 19
outerWidth( true ) 27
outerWidth( true ) 114
outerWidth( true ) 68
outerWidth( true ) 78
Chrome
outerWidth( true ) 68
outerWidth( true ) 63
outerWidth( true ) 44
outerWidth( true ) 55
outerWidth( true ) 23
outerWidth( true ) 31
outerWidth( true ) 131
outerWidth( true ) 78
outerWidth( true ) 88
IE 10 9
outerWidth( true ) 66
outerWidth( true ) 63
outerWidth( true ) 42
outerWidth( true ) 54
outerWidth( true ) 22
outerWidth( true ) 29
outerWidth( true ) 127
outerWidth( true ) 74
outerWidth( true ) 86
IE 8
outerWidth( true ) 68
outerWidth( true ) 63
outerWidth( true ) 44
outerWidth( true ) 55
outerWidth( true ) 23
outerWidth( true ) 31
outerWidth( true ) 131
outerWidth( true ) 78
outerWidth( true ) 88
。。。有趣的是,IE8和Chrome给出了同样的结果。
我错过了什么
我使用的是jQuery 1.9.1您是否使用了(删除浏览器特定于
边距
,填充
,字母间距
等的默认值)?您是否尝试过将框大小:边框框设置为元素(并且您可能需要使用供应商前缀)?对填充和边距设置为是,对框大小和边框框设置为否:-(尝试过,重置,没有Lucki如果您制作了小提琴,它是否仍以相同的方式运行?我会,好主意。但这需要一段时间。完成后,我将发布更新。