這裏的東西,這是CSS代碼for the image in h1畫面的不當表現在CSS
h1 { background-color: #000033;
background-image: url(sunset.jpg);
background-position: right;
background-repeat: no-repeat;
padding-left: 20px;
height: 72px;
color: #FFFFFF;
font-family: Georgia, serif;
line-height: 200%;
margin-bottom: 0; }
我使用的是相同的圖片sunset.jpg,但我的代碼是
h1{
background-image:url(images/sunset.jpg);
background-position: right;
background-repeat:no-repeat;
height:72px;
padding-left:20px;
color: #FFFFFF;
margin-bottom:0;
background-size:100% 100%;
line-height: 200%;
}
我有使用此代碼
background-size:100% 100%;
我只是不明白,爲什麼在第一個CSS代碼,它不使用background-size:100% 100%;
,仍然獲得完美的h1?
轉到該鏈接,刪除'背景color'設定爲元件。你會看到魔法被寵壞了。 – melancia 2014-09-29 16:29:00
喜歡這裏:http://jsfiddle.net/MelanciaUK/c2bLpszc/ – melancia 2014-09-29 16:30:59
隨着你的改變適用於:http://jsfiddle.net/MelanciaUK/c2bLpszc/1/ – melancia 2014-09-29 16:31:39