时间:2021-07-01 10:21:17 帮助过:32人阅读
ppskdkad
.div1{
opacity: 0;
width:200px;
height:200px;
border:1px solid red;
}
2.visibility:hidden还是只是把元素隐藏了,但是还是占有布局
看看效果
.div2{
visibility: hidden;
width:200px;
height:200px;
border:1px solid red;
}
3.display:none不会影响到布局
不信你看
.div3{
display: none;
width:200px;
height:200px;
border:1px solid red;
}
4.position:absolute不会影响到布局
看看
.div4{
position: absolute;
top:-9999px;
left:-9999px;
width:200px;
height:200px;
border:1px solid red;
}