我的背景圖像和它的文本是響應寬,只要在瀏覽器高度尺寸最大調整。但是,當減少瀏覽器(如Chrome)的高度時,背景圖像不再適合整個窗口。任何建議幫助!爲什麼背景圖片不響應瀏覽器的調整?
#header {
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(/img/roses.jpg);
background-size: cover;
background-position: center center;
height: 100vh;
}
.name h1 {
font-family: 'Muli', sans-serif;
font-size: 500%;
font-weight: 300;
text-align: center;
padding-top: 10%;
}
.name p {
font-family: 'Play', sans-serif;
font-size: 150%;
text-align: center;
padding-top: 5%;
}
.navigation p {
display: inline;
}
.navigation {
text-align: center;
padding-top: 10%;
}
.contents:hover {
color: white;
text-decoration: none;
}
.contents {
color: whitesmoke;
text-decoration: none;
}
/* Media Queries */
@media (max-width: 33.9em) {
.name h1 {
font-size: 300%;
}
.name p {
font-size: 100%;
}
}
<section id="header">
<div class="container">
<div class="row">
<div class="col-xs-12 name">
<h1>Temple Naylor</h1>
</div>
</div>
<div class="row">
<div class="col-xs-12 name">
<p>I create Web-designs with a sense of Feng-Shui in mind; resulting for a intuitive, responsive, harmonious, experience for users across the world. <br>
NOW AVAILABLE FOR YOU</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 navigation hidden-md-down">
<p><a class="contents" href="#">ABOUT</a>/</p>
<p><a class="contents" href="#">WORK</a>/</p>
<p><a class="contents" href="#">CONTACT</a>/</p>
<p><a class="contents" href="#">PHOTOGRAPHY</a></p>
</div>
</div>
</div>
</section>
這裏是什麼樣子時,瀏覽器高度縮短像http://imgur.com/a/2pSYB – YoungCoder
可以使用'背景尺寸100%100%'但在這種情況下,圖像將伸展,或你將不得不調整高度按照圖像高度寬度以適應在容器中。 –
創建一個真正的圖像提琴 –