页面实现居中显示的方法 流动
流动式布局,第一种
<!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>
<style type="text/css">
<!--
body {text-align:center;
}
#apDiv1 {
width:750px;
margin:0 auto;
text-align:left;
position:relative;
}
#right {
width:150px;
float:left;
background-color:#333300;
}
#left {
width:150px;
float:left;
background-color:#000000;
}
-->
#content {
width:450px;
float:left;
}
</style>
</head>
<body>
<div id="apDiv1">
<div id="left">
</div>
<div id="content">
<p>特帅吧,</p>
<p>居中显示!</p>
</div>
<div id="right">
</div>
</div>
</body>
</html>
就是用text-align来了个回,这就是我做点笔记给自己。:)
浙公网安备 33010602011771号