发布网友 发布时间:2022-05-13 17:13
共4个回答
懂视网 时间:2022-05-13 21:34
@charset "utf-8";/* CSS Document */*{ margin:0px; padding:0px;}body{ background-image: url(../images/bg.jpg); background-repeat:repeat-x; height:1000px; }body>div{ width:900px;}#wrap{ margin:0 auto;}#header{ height:80px; background:#fff;}#hl{ width:550px; height:80px; background:#fff; background-image: url(../images/logo.jpg); background-repeat: no-repeat; float:left; }#hr{ float:right; font-size:8px;}#nav{ background-image: url(../images/dh.jpg); height:30px; border:solid #fff 5px; border-width: 0px 0px 5px 0px;}#logo{ height:300px; background-image: url(../images/1.jpg);}#main{ height:400px; margin-top: 5px;}#ml{ height:400px; width:250px; background-image: url(../images/left.jpg); margin-right: 5px; float:left;}#mr{ height:25px; width:645px; float:right; color:blue;}#gsjj{ background:blue; font-family:"Microsoft YaHei"; font-size: 10px; color:#fff; font-weight: normal;}#footer{ margin-top: 10px; border:solid 1px blue; border-width: 1px 0px 0px 0px; text-align:center;}ul li{ width:100px; height:30px; float:left; color:#fff; list-style-type:none; padding-top: 5px; padding-left: 5px;}
CSS element>element 选择器
CSS element>element 选择器
CSS element>element 选择器
CSS element>element 选择器
index 设为主页|加入收藏
@charset "utf-8";/* CSS Document */*{ margin:0px; padding:0px;}body{ background-image: url(../images/bg.jpg); background-repeat:repeat-x; height:1000px; }body>div{ width:900px;}#wrap{ margin:0 auto;}#header{ height:80px; background:#fff;}#hl{ width:550px; height:80px; background:#fff; background-image: url(../images/logo.jpg); background-repeat: no-repeat; float:left; }#hr{ float:right; font-size:8px;}#nav{ background-image: url(../images/dh.jpg); height:30px; border:solid #fff 5px; border-width: 0px 0px 5px 0px;}#logo{ height:300px; background-image: url(../images/1.jpg);}#main{ height:400px; margin-top: 5px;}#ml{ height:400px; width:250px; background-image: url(../images/left.jpg); margin-right: 5px; float:left;}#mr{ height:25px; width:645px; float:right; color:blue;}#gsjj{ background:blue; font-family:"Microsoft YaHei"; font-size: 10px; color:#fff; font-weight: normal;}#footer{ margin-top: 10px; border:solid 1px blue; border-width: 1px 0px 0px 0px; text-align:center;}ul li{ width:100px; height:30px; float:left; color:#fff; list-style-type:none; padding-top: 5px; padding-left: 5px;}
加了那个后padding无效了
热心网友 时间:2022-05-13 18:42
body中加入一个div层,给该层定义一个class属性名,如:mian热心网友 时间:2022-05-13 20:00
这是设置边距的热心网友 时间:2022-05-13 21:35
设置Body的margin属性:<body style="margin-top:20px; margin-left:200px; margin-right:200px">。