ul li 横排(float:left) ie6多出间距_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:28:12
Original
1454 people have browsed it

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><style type="text/css">	.list{width:700px; overflow:hidden; border:solid 1px blue; padding:20px; }	ul,li {margin:0; padding:0; list-style:none}	ul{border:solid 1px green; display:inline-block; background:#d5d5d5; width:100%;}	li{width:250px; height:150px; border:solid 1px red; float:left; margin:15px 0 15px 50px;}</style><title>无标题文档</title></head><body><div class="list">	<ul>		<li>dsdddddddddddddddddddddd</li>		<li>dsdddddddddddddddddddddd</li>		<li>dsdddddddddddddddddddddd</li>		<li>dsdddddddddddddddddddddd</li>		<li>dsdddddddddddddddddddddd</li>	</ul>	<div style="clear:both"></div></div></body></html>
Copy after login


li通过float:left 横排后,ie6中所有的li会距离ul内左边多一倍左右的距离,怎么消除??


回复讨论(解决方案)

给li设置一个display:inline

或者不使用margin,使用padding代替。再或者,不使用浮动。使用inline-block布局。

可以搜索:IE6双外边距的bug,查看一下相关的内容。

因为浮动ie6会产生双倍bug,给ie6加个_display:inline

.list{width:700px; overflow:hidden; border:solid 1px blue; padding:20px; }

去掉你的padding

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template