|
|

/*CSS文件的内容*/
#dabiaoge{width:800px;height:400px;margin-top:100px;Background-color:#000000} /*表格宽度800,高度400,与顶部距离100,背景颜色
黑*/
.biaoge1{width:436px;float:left;Background-color:#ff0000;margin-top:150px} /*表格宽度436,靠左对齐,背景颜色红,顶部距
离150*/
.biaoge1-1{width:200px;height:auto;Background-color:#0000ff;Margin-top:70;} /*表格宽度200,高度自动,背景颜色蓝,顶部距离
70*/
.biaoge1-2{width:150px;Background-color:#ffffff;Margin-top:20;}
.biaoge2{width:310px;float:right;Background-color:#ffff00} /*表格宽度310,靠右对齐,背景颜色黄*/
.biaoge2-1{width:200px;height:40;Background-color:#0000ff;margin-top:50px;Margin-top:20} /*表格宽度200,高度40,背景颜色蓝,距
离顶部50*/
下面是DIV.HTML
<link rel="stylesheet" type="text/css" href="css.css" />
<div id="dabiaoge">
<div class="biaoge1">
<div class="biaoge1-1">
内容显示1111
</div>
<div class="biaoge1-2">
内容显示1111-1
</div>
</div>
<div class="biaoge2">
<div class="biaoge2-1">
内容显示2222
</div>
</div>
</div>
以上只是简单的示范,DIV的样子好看与否,全都在CSS里边定义。还可定义表格线条粗细、颜色、包个内的字体颜色、连接颜色等等,就和HTML一样的了
实际制作中难点就在于使用DIV做美化时界面比较难掌握,以及还需要对CSS的充分了解。
我也是刚接触CSS+DIV,说的不好的、不对的还请大家指教! |
|