摘要:css浮动属性的学习 学习了怎么把几个DIV用浮动 显示在一行中,浮动属性是:float 它有2个值左右 清除浮动属性是clear <!doctype html><html><head><meta char
css浮动属性的学习 学习了怎么把几个DIV用浮动 显示在一行中,浮动属性是:float 它有2个值左右 清除浮动属性是clear
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>css浮动属性的学习</title>
<style type="text/css">
.cl{
clear:both;
}
ul li{
list-style: none;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
background: #ccc;
margin: 1px 5px;
float: left;
}
.box1{
width: 200px;
height: 200px;
background-color: rgba(123,20,22,1.00);
margin: 1px 5px;
float: left;
}
</style>
</head>
<body>
<ul>
<li>html</li>
<li>css</li>
<li>php</li>
</ul>
<div class="cl"></div>
<div class="box1">div1</div>
<div class="box1">div2</div>
<div class="box1">div3</div>
</body>
</html>
批改老师:灭绝师太批改时间:2018-11-17 16:28:17
老师总结:可以,现在的练习还比较简单,后面还会结合案例,加油,继续保持