演示代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="reset.css"/>
<style type="text/css">
ul{width: 300px;margin: 100px auto;background-color: #222222;}
li{width: 100px;height: 100px;float: left;}
.a{background-color: #ff0000;}
.b{background-color: #00ff00;}
.c{background-color: #0000ff;}
</style>
</head>
<body>
<!--
浮动:让块级元素在一行
语法:float: 方向;
-->
<ul>
<li class="a"></li>
<li class="b"></li>
<li class="c"></li>
</ul>
</body>
</html>