我的页面标题结构为
<header>
<div class="clouds"></div>
</header>
屏幕的宽度不会改变云。我想让他们响应。如何使用CSS。
我目前使用以下CSS代码。
header{
width:100%;
height:100%;
}
.clouds{
z-index: -98;
position: absolute;
top:0px;
left: 0px;
width:100%;
background: url('../images/clouds.png') repeat-x;
-webkit-background-size: 100%;
-o-background-size: 100%;
background-size: 100% !important;
height: 30%;
min-width: 960px;
}
您不应该添加高度和宽度,这应该做到最少
background: url('../images/clouds.png')
background-repeat:no-repeat;
background-size:contain;
background-position:center;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句