我是这个引导程序的新手。我有一个背景图片,我想放入容器液。怎么做。
这是我的代码:
<div class="image_outer">
<div class="container-fluid">
<div class="row-fluid">
<div class="span5">
<div class="fl navi"> <a href="#" title="One" class="mr30">One</a> <a href="#" title="two">TwoP</a> </div>
</div>
<div class="span2"">
<div id="image1"><img src="/Something/something.jpg" alt="" /></div>
</div>
<div class="span5">
<div class="fr navi"> <a href="#" title="three" class="mr30">Three</a> <a href="#" title="four">Four</a> </div>
</div>
</div>
</div>
</div>
相应的类是
.image_outer{width:100%;margin:0 auto; background:url(Something/something_bg.jpg) repeat-x; height:128px;}
.fl{float:left;}
.fr{float:right;}
.mr30{margin-right:100px; font-family: ee_nobblee,arial;}
.navi a{ font-size:22px; color:#6D6E70; margin-top:50px; float:left; font-weight:normal; font-family:ee_nobblee,arial;}
.navi a:hover { text-decoration:none; color:#858687;}
答案 0 :(得分:1)
试试这个CSS:
.image_outer {
width:100%;
margin:0 auto;
background:url(Something/something_bg.jpg) repeat-x;
height:128px;
background-position:cover;
}
答案 1 :(得分:0)
我可能错了,你是漂浮的孩子。你需要清除浮动,以便背景占用指定的高度。
<div class="row-fluid">
<div class="span5">
<div class="fl navi"> <a href="#" title="One" class="mr30">One</a> <a href="#" title="two">TwoP</a> </div>
</div>
<div class="span2"">
<div id="image1"><img src="/Something/something.jpg" alt="" /></div>
</div>
<div class="span5">
<div class="fr navi"> <a href="#" title="three" class="mr30">Three</a> <a href="#" title="four">Four</a> </div>
</div>
<div style="clear:both"></div>
</div>
答案 2 :(得分:0)
使用这样的代码,我希望这适用于图像
.image_outer {width:100%; margin:0 auto; background:url(../ Something / something_bg.jpg)repeat-x; 高度:128像素;}