css - 背景图像未缩放到手机。

标签 css responsive-design media-queries

我有一个基于 html5 wordpress 空白的网站。

http://thesemachinesarewinning.com/

如您所见,它会根据浏览器窗口调整大小和缩放,但在移动设备上,背景图像不会缩放, Logo 和导航仅在横向 View 中完全显示。

@media only screen and (min-width:320px) {

}
@media only screen and (min-width:480px) {

}
@media only screen and (min-width:768px) {

}
@media only screen and (min-width:1024px) {

}
@media only screen and (min-width:1140px) {

}
@media only screen and (min-width:1280px) {

}
@media only screen and (-webkit-min-device-pixel-ratio:1.5),
       only screen and (min-resolution:144dpi) {

}

/* css for the nav and background image

body {
    font:300 11px/1.4 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height:100%;
    z-index:1;
    background:url('img/home-bg.jpg') no-repeat fixed center right;
    background-size: cover;
    width:100%;
    margin:0;
    padding:0;
}
.page-section {
    width:100%;
    margin:0px auto 0px auto;
    overflow-x:hidden;
    z-index:100;
}
.nav-wrapper {
    margin:3px auto 0px auto;
    float:left;
}
.wrapper {
    max-width:1280px;
    width:95%;
    margin:0 auto;
    position:relative;
    background-color:transparent;
}

最佳答案

尝试用这个替换你当前的视口(viewport):

<meta name="viewport" content="width=device-width, initial-scale=1">

关于css - 背景图像未缩放到手机。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22359653/

相关文章:

css - IE 加载的样式表不超过 30 个(drupal)?

css - 如何在仅使用 CSS 并支持视网膜显示的响应式网格中居中图像?

html - Flexbox 元素不会在浏览器窗口调整大小时重新排序,但会在响应模式下重新排序

jquery - 使用 css 媒体查询触发 jquery

css - 媒体查询的不同设备高度

css - 显示 :table-cell not working on an input element

html - lesscss之谜

html - 响应式菜单推送内容

css - 最大的媒体查询(最小宽度 :1020px) keeps overriding smallest media query's (max-width:599px) flex-direction value

firefox - FireFox 3.6.15+ 中图像的圆 Angular 仍然不起作用?