html与css的网页布局

网页布局分为四类

1.一列布局   2.二列布局    3.三列布局   4.混合布局

1.一列布局
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        body{margin: 0px;padding: 0px}
        .head{没有宽度  height: 50px;background: black}
        .section{width: 600px;height: 300px;background: rosybrown;
盒子居中  margin: 0 auto}
        .foot{width: 600px;height: 250px;background: salmon;
盒子居中  margin: 0 auto}
    </style>
</head>
<body>
       <div class="head"></div>
       <div class="section"></div>
       <div class="foot"></div>
</body>
</html>

 效果图 

猜你喜欢

转载自www.cnblogs.com/liu13-B/p/9987222.html