2013年4月8日 星期一

css+html 的網頁分割

a.html
<html>
<head>
<link href="a.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrap">
<div id="topColumn">我是上面區塊</div>
<div id="sideColumn">我是左邊區塊</div>
<div id="mainColumn">我是右邊區塊</div>
</div>
</body>
</html>


a.css
#wrap {width:900px;margin:0 auto;overflow:hidden;}
#topColumn {background-color:red;}
#sideColumn {background-color:green;width:300px;float:left;}
#mainColumn {background-color:blue;float:left;width:600px;}

沒有留言:

張貼留言