有关浮动属性的作用

原创 2018-12-29 19:07:43 256
摘要:<!DOCTYPE html><html><head><meta charset="UTF-8"><title>导航</title><style type="text/css">*{margin: 0px;padding: 0px;}ul li{list-style: non

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>导航</title>

<style type="text/css">

*{margin: 0px;padding: 0px;}

ul li{list-style: none;}

.header{width: 100%;height: 40px;background-color: #000;}

ul{width:612px;height: 40px;margin:0 auto;}

ul li{width: 100px;height: 38px;line-height: 38px;text-align: center;border: 1px solid #ccc;float: left;}

ul li a{text-decoration: none;font-size: 14px;color: orange;display: block;}

ul li a:hover{color: red;font-size: 18px;background-color: #424242;}

.count{width: 612px;background-color: #ccc;margin: 0 auto;}

.count .left{width: 40%;height: 400px;float: left;background-color: blue;}

.count .right{width: 60%;height: 400px;float: right;background-color: red;}

.footer{height: 60px;background-color: #000;color: #fff;clear: both;}

</style>

</head>

<body>

<div>

<ul>

<li><a href="#">HTML</a></li>

<li><a href="#">CSs</a></li>

<li><a href="#">JS</a></li>

<li><a href="#">JQuery</a></li>

<li><a href="#">php</a></li>

<li><a href="#">Java</a></li>

</ul>

</div>

<div>

<div>左面</div>

<div>右面</div>

</div>

<div>底部</div>

</body>

</html>


批改老师:天蓬老师批改时间:2018-12-30 13:41:54
老师总结:页面中一旦用了浮动, 就是一定小心了, 因为浮动不好控制,一定要细心

发布手记

热门词条