css技巧浮动居中实例

<!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>css技巧浮动居中</title>
<style type="text/css">
body,h1,h2,h3,h4,h5,h6,dl,dt,dd,ul,ol,li,th,td,p,pre,form,input,button{margin:0; padding:0;}
table{border-collapse:collapse;border-spacing:0;}
h2{font-size:14px;}
ul,ol{list-style:none;}
body{font-size:14px;margin:0 auto;color:#666666; font-family:/*"微软雅黑",*/Arial,Helvetica,sans-serif;background:#eeeeee; }
fieldset,img{border:0;}
img{vertical-align:middle;}
input,textarea{ border:none 0;}
a{text-decoration:none;color:#787878;}
a:hover{ text-decoration:underline;}
#macji{position:relative;width:600px;height:80px;background:#999999;text-align:center;overflow:hidden;}
.macji-skin{float:left;position:relative; left:50%;}
.macji-skin li{ float:left;position:relative;right:50%; margin:10px;border:solid 1px #000;line-height:60px;}
</style>
</head>

<body>
<div id="macji">
    <ul class="macji-skin">
        <li><a href="" title="" target="_blank">列表一</a></li>
        <li><a href="" title="" target="_blank">列表一</a></li>
        <li><a href="" title="" target="_blank">列表一</a></li>
    </ul>
</div>
</body>
</html>
posted @ 2012-07-02 11:57  lines  阅读(2042)  评论(0编辑  收藏  举报