今天学到了一些新知识(CSS)拿出来和大家分享
margin是设置浮动div与ie得外边距包括上右下左,
padding是设置div内的内容与div得内边距也是上右下左的顺序
float用于设置浮动div浮动在那里
clear用于清除浮动属性如果同时设置了float与clear则clearz属性生效
下面是一个我做的实例
<head>
<style type="text/css">
body{margin:0;
padding:0;
}
#a {height:300px;
width:300px;
background-color:#CC0000;
float:left;
}
#b {height:300px;
width:300px;
background-color:#009;
float:left;
}
#c {height:50px;
width:60px;
background-color:#999999;
text-align:center;
float:left;
clear:left;
}
</style>
</head>
<body>
<div id="a">blog左边</div>
<div id="b">blog右边</div>
<div id="c">版权信息</div>
</body>
</html>