CSS中的浮动

Original 2019-04-26 14:34:19 152
abstract:<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>我的PHP</title>    <style type="te

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>我的PHP</title>
   <style type="text/css">
ul li{
           list-style: none;width: 100px;height: 40px;line-height: 40px;text-align: center;background-color: palevioletred;
margin: 0px 1px;float: left;
}
       .box1{width: 200px;height: 200px;background-color: blueviolet;float: right;}
       .clear{clear: both;color: red;}
   </style>
</head>
<body>
<ul>
   <li>首页</li>
   <li>电视剧</li>
   <li>电影</li>
   <li>综艺</li>
   <li>动漫</li>
   <li>其他</li>
</ul>
<div class="clear">这是第一块</div>
<div class="box1">这是第二块</div>
<div class="box1">这是第三块</div>
<div class="box1">这是第四块</div>
</body>
</html>

Correcting teacher:西门大官人Correction time:2019-04-27 17:32:18
Teacher's summary:.clear{clear: both;color: red;}这里应该是清除浮动的。color:red加这里?

Release Notes

Popular Entries