61,112
社区成员
发帖
与我相关
我的任务
分享
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<style type="text/css">
div{width:1000px; border:1px solid #f00; overflow:hidden;}
div ul{margin: 0;padding: 0; overflow:hidden; margin-right:-20px;list-style:none;}
div ul li{width:235px; float:left; height:235px;margin-right:20px;margin-bottom:20px; background:#ddd;}
</style>
<div>
<ul>
<li>1</li><li>2</li><li>3</li><li>4</li>
<li>5</li><li>6</li><li>7</li><li>8</li>
<li>9</li><li>10</li><li>11</li><li>12</li>
</ul>
</div>
</body>
</html>
分三层,最外层设置宽度,第二层不要设置宽度,设置要向右超出多少。第三层就是列表了。