2014-08-30 109 views

回答

1

考虑到你已经有一个引导旋转木马的工作,你可以做这样的事情:

<div class="item"> 
    <img src="yourimagebackground" alt=""> 
     <div class="container"> 
     <div class="carousel-caption"> 
      <p> your caption here</a> 
     </div> 
     </div> 
</div> 

要设置字幕的背景,你可以在你的CSS这样做

.carousel-caption { 
position: absolute; 
right: 0; 
bottom: 0; 
left: 0; 
padding: 15px; 
background: rgba(0, 0, 0, 0.75); 
} 

这里,background: rgba(0, 0, 0, 0.75);会将标题的背景设置为透明黑色。如果你想要它完全黑色,你可以用background: black;替换它,这取决于你!

+0

谢谢。它在底部,但我不能使它具有相同的浏览器宽度。我应该怎么做? – lowcoupling 2014-08-31 06:16:26

+0

你可以编辑你的问题,并添加相关的代码?然后,我将能够进一步帮助你。 – Cyzanfar 2014-08-31 09:21:42