Css Internet Explorer 8中的LI元素
由于某些原因,我的LI元素在internetexplorer中不会向左浮动,而是显示在彼此的下方。有人知道我该怎么解决这个问题吗Css Internet Explorer 8中的LI元素,css,internet-explorer-8,Css,Internet Explorer 8,由于某些原因,我的LI元素在internetexplorer中不会向左浮动,而是显示在彼此的下方。有人知道我该怎么解决这个问题吗 #books ul{ list-style:none; margin:0px; float:left; display:inline; } #books ul li{ float:left; margin-right: 20px; padding-bottom: 20px; height:300px;
#books ul{
list-style:none;
margin:0px;
float:left;
display:inline;
}
#books ul li{
float:left;
margin-right: 20px;
padding-bottom: 20px;
height:300px;
display:inline;
}
如果我正确理解您的问题,可能与设置display:inline有关。更改为显示:块;似乎解决了IE和FF中的问题
#books ul{
list-style:none;
margin:0px;
float:left;
display:block;}
#李国宝{
浮动:左;
右边距:20px;
垫底:20px;
高度:300px;
显示:block;}
不需要使用float,如果您只想将每个LI内联,可以只使用display属性
#books ul{
width: 100%;
list-style: none;
margin: 0px;
}
#books ul li{
margin-right: 20px;
padding-bottom: 20px;
height: 300px;
display: inline-block;
}
你能提供html和css吗?它在其他浏览器中工作吗?我在问题中添加了css。是的,它可以在firefox中正常工作。您使用兼容性视图吗?默认情况下,它们已经被阻止,所以我只需删除整个属性。