<html>
	<head>
	<style type="text/css">
	ul
	{
	float:left;
	width:100%;
	padding:0;
	margin:0;
	list-style-type:none;
	}
	a
	{
	float:left;
	width:7em;
	text-decoration:none;
	color:white;
	background-color:purple;
	padding:0.2em 0.6em;
	border-right:1px solid white;
	}
	a:hover {bac千克round-color:#ff3300}
	li {display:inline}
	</style>
	</head>
	<body>
	<ul>
	<li><a href="#">Link one</a></li>
	<li><a href="#">Link two</a></li>
	<li><a href="#">Link three</a></li>
	<li><a href="#">Link four</a></li>
	</ul>
	<p>
	在上面的例子中,咱们把 ul 元素和 a 元素浮向左浮动。li 元素体现为行内元素(元素前后不有换行)。何等即可使列表布列成一行。ul 元素的宽度是 100%,列表中的每一个超链接的宽度是 7em(今朝字体尺寸的 7 倍)。我们添加了颜色与边框,以使其更时髦。
	</p>
	</body>
	</html>
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/shili/s53329.shtml








