标签:charset 分享 bin 分享图片 abs height set head font
前言
HTML部分 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>一列布局</title> </head> <body> <div class="head">head</div> <div class="main">main</div> <div class="foot">foot</div> </body> </html> CSS部分 div{text-align: center;} .head{height: 60px;background-color:#fae1e1;} .main{margin: 0 auto;height:300px;background-color:#e6686a;} .foot{margin: 0 auto;background-color:red;}
HTML部分 <!DOCTYPE html> <html> <head> <title>二列布局</title> </head> <body> <div class="main"> <div class="left">left</div> <div class="right">right</div> </div> </body> </html CSS部分 body{ margin:0; padding:0; font-size:20px; font-weight:bold} div{ text-align:center; line-height:50px} .main{ width:80%; height:400px; margin:0 auto} .left{ width:20%; height:400px; background:#e6686a; float:left} .right{ width:80%; height:400px; background:#fae1e1; float:right}
效果图如下:
HTML部分 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JS Bin</title> </head> <body> <div class="left">left</div> <div class="center">main</div> <div class="right">right</div> </body> </html> CSS部分 body{ margin:0; padding:0; font-weight:bold} div{ line-height:40px} .left{height:400px; width:200px; position: absolute; left:0; top:0;background:#fae1e1;} .right{ height:400px; width:200px; position:absolute; top:0;right:0;; background:#fae1e1} .center{ height:400px; margin:0 200px; background:#e6686a}
标签:charset 分享 bin 分享图片 abs height set head font
原文地址:https://www.cnblogs.com/nolaaaaa/p/8849187.html