我目前有一個網站,使用從Codecademy的「如何製作網站」教程引導的jumbotron功能。如何在較大的顯示器上縮放jumbotron引導程序?
在這裏面,它使用以下HTML:
<div class="jumbotron">
<div class="container">
<h1>Heading</h1>
<p>Tagline</p>
<a href="#About"><button type="button" class="btn btn-lg btn-danger">Learn More</button></a>
<!--<a href="#">Learn More</a>-->
</div>
</div>
和下面的CSS:
.jumbotron {
background-image:url("flight.jpg");
height: 500px;
background-repeat: no-repeat;
background-size: cover;
margin-bottom:0px;
}
.jumbotron .container {
position: relative;
top:100px;
}
.jumbotron h1 {
color: #CC0000;
font-size: 48px;
font-family: 'Shift', sans-serif;
text-shadow:none;
}
.jumbotron p {
font-size: 20px;
color: #CC0000;
text-shadow:none;
}
背景圖像不結垢正確當使用更大的顯示器,並且將圖像的增加在div內的大小,但div保持相同的大小。結果看起來像放大圖像而不是圖像保持整體。
任何想法如何使它在較大的顯示器上正確縮放?
我刪除了容器股利和問題仍然存在。我認爲它與被圖像寬度大於圖像寬度的圖像相關。我仍然不確定如何解決它。我把一個例子放在www.galacticchef.com – hasanzuav 2014-12-02 00:13:32
試試這個......還有**添加容器** ......你需要將內容集中在jumbotron中。 – Rafael 2014-12-02 00:17:52
此外,該網站看起來非常酷,我喜歡你的顏色組合。 – Rafael 2014-12-02 00:25:08