[英]get background image or text to fill width, not repeat, but not stretch vertically
[英]Getting a background image to stretch vertically
我創建了一個帶有一些帶條紋圖像(寬度為62px,高度為32px)的簡單CSS的網頁,並且希望其垂直向下一直重復到頁面底部。 我的問題是,它停在內容的末尾,例如,如果我輸入“ Test”,它將很小。 如果我有整篇文章,它會重復執行-如果頁面不滾動,則不會重復太多。
圖片: http : //avaworld.net/images/bordLeft-blue.png
網站-http: //www.avaworld.net/
#blueWrap { margin: 0; background-color: #131313; padding: 0; display: block; }
#blueRight { padding-right: 62px; background: url(http://avaworld.net/images/bordRight-blue.png) top right repeat-y; }
#blueLeft { padding-left: 62px; background: url(http://avaworld.net/images/bordLeft-blue.png) top left repeat-y; }
<div id="blueWrap">
<div id="blueRight">
<div id="blueLeft">
Test
</div>
</div>
</div>
將此應用到您的CSS
body, #blueWrap, #blueRight, #blueLeft{height:100%;}
body, #blueWrap, #blueRight, #blueLeft{height:100%;}
在於,當您有很多內容時, blueRight
和blueLeft
元素在滾動時將不會跟隨頁面。
對於blueRight
和blueLeft
屬性,請在其CSS中嘗試添加: position: fixed; height: 100%;
position: fixed; height: 100%;
position: fixed;
表示div
即使滾動也將保持在該位置。
height: 100%;
是使高度為100%。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.