CSS 清除float(浮动)属性----案例Windows系统logo

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.c1{
width: 200px;
height: 200px;

float: left;
}
.c2{
width: 200px;
height: 200px;
background-color: green;
/*float:left左 right右*/
float: left;
}

.c3{
width: 200px;
height: 200px;
/*clear:left左 right右 both左和右都*/
float: left;

clear: both;
}
.c4{
width: 200px;
height: 200px;
background-color: yellow;
float: left;
}

</style>
</head>
<body>

<div class="c1"></div>
<div class="c2"></div>
<div class="c3"></div>
<div class="c4"></div>

</body>
</html>

 

posted @   呼长喜  阅读(29)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示