CSS浮动属性小结

Original 2019-01-24 13:21:38 254
abstract:本章主要讲CSS浮动属性:floatfloat:left向左浮动 right向右浮动清除浮动:clear:left 清除左浮动 right清除右浮动 both左右都清除案例:<html><meta charset="utf-8"> <title>CSS浮动</title><style type="text

本章主要讲CSS浮动属性:float

float:left向左浮动 right向右浮动

清除浮动:clear:left 清除左浮动 right清除右浮动 both左右都清除

案例:

<html>

<meta charset="utf-8">

 <title>CSS浮动</title>

<style type="text/css">

.meun{margin:20 auto;}

.meun ul li{list-dtyle:none; width:120; height:60px;  border:sliod 1px #ccc; margin:0px 2px; float:left;  }

.clear{clear:both;}

.boxs1{width:300px; height:200px; border:sliod 2px red; float:right;}


</style>

<body>

<div class="meun">

<ul>

<li>导航1</li>

<li>导航2</li>

<li>导航3</li>

<li>导航4</li>

<ul>

</div>

<div class="clear"></>

<div class="boxs1"></>

<div class="boxs1"></>

<div class="boxs1"></>


</body>

</html>

Correcting teacher:西门大官人Correction time:2019-01-24 13:39:35
Teacher's summary:作业完成的不错,如果能把运行效果图上传一下最好了。

Release Notes

Popular Entries