我目前正在建立一個wordpress網站,我需要一個div的100%寬度的背景(css顏色,沒有圖像)。我的div在一個容器內,我不能修改html。所以,我想知道是否有任何方式與CSS來做到這一點。我已經嘗試了填充+邊距黑客,但它沒有奏效。如何在twitter引導的容器內有100%寬度的背景?
HTML:
<div class="container">
<div class="row-fluid">
<div class="main span12">
<div class="row-fluid blue"> <!--this is the div that needs the background-->
<div class="span4">some content</div>
<div class="span4">some content</div>
<div class="span4">some content</div>
</div>
<div class="row-fluid">
<div class="span12"> some other content, doesn't need the background</div>
</div>
</div>
</div>
</div>
任何幫助深表感謝。我試過這個:http://www.sitepoint.com/css-extend-full-width-bars/但它沒有工作。
Pseudo elements to the rescue - ** http://css-tricks.com/full-browser-width-bars/ ** –