css overflow属性有什么用

254次阅读
没有评论

css

1、配合浮动父容器,解决父容器高度塌陷的问题。

2、利用overflow扩展盒子高度,overflow属性可以触发浏览器重新计算父元素盒子高度。

实例

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
#wrap2 {
width: 55px;
border: 3px solid red;
overflow: hidden;
}
 
 
.class1 {
width: 20px;
height: 40px;
background: blue;
float: left;
}
 
 
.class2 {
width: 20px;
height: 30px;
background: yellow;
float: left;
}
 
 
.class3 {
width: 20px;
height: 30px;
background: fuchsia;
float: left;
}
 
 
.class4 {
width: 20px;
height: 20px;
background: chartreuse;
float: left;
}
</style>
<title></title>
</head>
<body>
<div id="wrap2">
<div></div>
 
<div></div>
 
<div></div>
 
<div></div>
 
</div>
</body>
</html>

以上就是css overflow属性的作用,希望对大家有所帮助更多css学习指路:css教程

本文教程操作环境:windows7系统、css3版,DELL G3电脑。

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:JavaScript2022-12-19发表,共计665字。
新手QQ群:570568346,欢迎进群讨论 Python51学习