2016-05-03 1 views
1

カルーセルキャプションに不透明度が50%の背景が必要です。以下のコードを試しましたが、IE11以前では動作しません。私はそれについて古い記事を見てきましたが、これらのソリューションのどれもIEで動作しません。Bootstrap3では、どのようにカルーセルキャプションに50%の不透明度の背景を付けることができますか?

.carousel-caption { 
background: rgba(255, 184, 28, 0.5);} 

も、この勾配のために:

.carousel-caption { 
background: linear-gradient(to bottom, rgba(255, 184, 28, 1), rgba(255, 184, 28, 0.5));} 

HTML:

<!--START CAROUSEL--> 
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="false"> 
    <!-- Wrapper for slides --> 
    <div class="carousel-inner" role="listbox"> 
    <div class="item active"> 
     <img src="../../images/LD/desktop_hero1.png" alt="..." class="img-responsive"> 
     <div class="carousel-caption"> 
     Text for caption 1 here. 
     </div> 
    </div> 
    <div class="item"> 
     <img src="../../images/LD/desktop_hero2.png" alt="..." class="img-responsive"> 
     <div class="carousel-caption"> 
     Text for caption 2 here. 
     </div> 
    </div> 
    <div class="item"> 
     <img src="../../images/LD/desktop_hero3.png" alt="..." class="img-responsive"> 
     <div class="carousel-caption"> 
     Text for caption 3 here. 
     </div> 
    </div> 
    </div> 

    <!-- Controls --> 
    <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> 
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> 
    <span class="sr-only">Previous</span> 
    </a> 
    <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> 
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> 
    <span class="sr-only">Next</span> 
    </a> 
</div>  
<!--END CAROUSEL--> 

CSS:

<style type="text/css"> 
.carousel-caption { 
max-width: 100%; 
width:100%; 
background: rgba(255, 184, 28, 0.5);}; 
left: 0; 
bottom: 0; 
color:#000000; 
} 
</style> 

は、私はこれを試してみました

ANSWER: これをCSSに追加する必要がありました。 フィルタ:alpha(opacity = 50);

+0

IE11で動作するはずです、あなたは他のブラウザを試してみましたか?また、あなたのHTMLを投稿してください。 –

+0

Firefoxでは動作しましたが、IEでは動作しませんでした。私はちょうど私のHTMLとCSSを追加しました。 –

+0

私はちょうどそれを考え出した。フィルタを追加するだけでした:alpha(不透明度= 50);私のCSSに。 –

答えて

1

私が行うために必要なすべては、次のスタイルの更新を追加した:

filter: alpha(opacity=50); 
関連する問題