星空网 > 软件开发 > 网页设计

清除浮动1

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Author" content="胡超">
<title>super胡</title>
<style>
.news {
background-color: gray;
border: solid 1px black;

}
.news img {
float: left;
}

.news p {
float: right;
}
.clearfix:after{
content: ".";
display:block;
height:0px; /*一、该方法中必须为需要清除浮动元素的伪对象中设置 height:0,否则该元素会比实际高出若干像素;*/
clear: both;
visibility: hidden;
}

.clearfix {
/* 触发 hasLayout */
zoom: 1;
}
</style>
</head>
<body>
<div >
<img src='/images/loading.gif' data-original="7v/1318240446520.jpg" />
<p>some text</p>
</div>

</body>
</html>




原标题:清除浮动1

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流