开发者

LI element in Internet Explorer 8

开发者 https://www.devze.com 2022-12-13 05:43 出处:网络
for some reason my LI elements are not floated to the left in internet explorer, they are showed each below the other. Anybody knows how I could fix this?

for some reason my LI elements are not floated to the left in internet explorer, they are showed each below the other. Anybody knows how I could fix this?

#books ul{
    list-style:none;
    margin:0px;
    float:left;
    display:inline;
}
#bo开发者_JAVA百科oks ul li{
    float:left;
    margin-right: 20px;
    padding-bottom: 20px;
    height:300px;
    display:inline;
}


If I understand your issue correctly, it may have to do with setting display: inline. Changing to display:block; seems to solve the issue in IE and FF.

#books ul{
list-style:none;
margin:0px;
float:left;
display:block;}

#books ul li{ float:left; margin-right: 20px; padding-bottom: 20px; height:300px; display:block;}


There is no need to use float, if you just want each LI to be inline you can use just the display property.

#books ul{
    width: 100%;
    list-style: none;
    margin: 0px;
}
#books ul li{
    margin-right: 20px;
    padding-bottom: 20px;
    height: 300px;
    display: inline-block;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消