61,129
社区成员




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
*{margin:0;padding:0;}
div{width:800px;border:solid 1px #000;padding:20px;margin:30px auto;text-align:center;}
p{display:inline-block;width:150px;height:150px;margin:10px;background:gray;color:#fff;}
-->
</style>
</head>
<body>
<div>
<p>左边左边</p>
<p>右边右边</p>
</div>
</body>
</html>
<style type="text/css">
.div1{width: 1000px; height: 500px; border: 1px solid #000;}
.div2{width: 300px; height: 200px; margin: 0 auto; background: red; float: left; position: relative; left: 50%; margin-left: -150px;}
</style>
<div class="div1">
<div class="div2"></div>
</div>