Css 如何使背景在不同的屏幕尺寸上只水平调整大小?
我希望我的背景只对屏幕大小的变化做出水平响应,我不希望周围有灰色的框架 分区的CSS:Css 如何使背景在不同的屏幕尺寸上只水平调整大小?,css,twitter-bootstrap,Css,Twitter Bootstrap,我希望我的背景只对屏幕大小的变化做出水平响应,我不希望周围有灰色的框架 分区的CSS: .col-xs-8.arrow-red { background-image: url(../img/arrow-red.png); background-repeat: no-repeat; background-size: 100%; background-position: center center; height: 135px
.col-xs-8.arrow-red {
background-image: url(../img/arrow-red.png);
background-repeat: no-repeat;
background-size: 100%;
background-position: center center;
height: 135px;
}
这在桌面上:
在iPad上:
您可以为背景设置固定高度; 像这样使用-
-o-background-size:100% 50px;
-webkit-background-size:100% 50px;
-moz-background-size:100% 50px;
background-size:100% 50px;