当我在桌面上查看页面时,它工作正常,图像响应迅速。当我直接在iPhone上查看页面时,图像不正确。Jumbotron背景图片不响应
的Index.html
<header>
<div class="jumbotron">
<div class="container" id="maincontent" tabindex="-1">
<div class="row">
<div class="col-lg-12">
<div class="intro-text">
<h1 class="name">Headline</h1>
<hr class="star-light">
<span class="skills">Sub-header</span>
</div>
</div>
</div>
</div>
</div>
</header>
的style.css(freelance.css)
.jumbotron {
background: url("http://vlastapolach.cz/img/expecto.jpg") no-repeat fixed;
background-size: cover;
background-position: top center;
height: auto;
}
全部代码是在这里:https://github.com/vlastapolach/portfolio
我尝试了这些,但它在桌面上无法正常工作。
background-size: contain;
background-size: auto;
background-size: 100% 100%;
尝试包括宽度:100%; – jmag
看看[文档](https://v4-alpha.getbootstrap.com/content/images/#responsive-images)。 '''Bootstrap中的图像与.img-fluid相关。最大宽度:100%;和高度:自动;被应用到图像,以便它与父元素的比例尺' – Dwhitz
@jmag我加了他们两个'最大宽度:100%; 宽度:100%;'但同样的结果 - 在个人电脑上它是响应式的,但不是在移动设备上。 –