2017-03-14 2 views

答えて

1

それを見ることができますあなたは相対的にカルーセルの位置を設定して、あなたはボタンがに表示したい以内にボタンを配置し、次に設定することにより、これを行うことができます。これが行われた後は、ボタンの位置を絶対値に設定する必要があります。これが完了すると、カルーセル画像にボタンが表示され、配置したい場所にボタンを配置するだけです。

このような質問の回答には、このような例があります。CSS - position button inside image

0

ここでは、ブートストラップ3に内蔵されたカルーセルを使用し、最初のスライドにボタンを使用した例を示します。

<div class="container"> 
    <br> 
    <div id="myCarousel" class="carousel slide" data-ride="carousel"> 

    <!-- Wrapper for slides --> 
    <div class="carousel-inner" role="listbox"> 
     <div class="item active"> 
     <img src="http://placehold.it/1400x400" alt="slide"> 
     <div class="carousel-caption"> 
      <a href="https://www.google.co.uk/" target="_blank"><button type="button" class="btn btn-default">Read More</button></a> 
     </div> 
     </div> 

     <div class="item"> 
     <img src="http://placehold.it/1400x400" alt="slide"> 
     </div> 

     <div class="item"> 
     <img src="http://placehold.it/1400x400" alt="slide"> 
     </div> 

     </div> 
    </div> 

    <!-- Left and right controls --> 
    <a class="left carousel-control" href="#myCarousel" 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="#myCarousel" role="button" data-slide="next"> 
     <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> 
     <span class="sr-only">Next</span> 
    </a> 
    </div> 
</div> 

あなたはhere

関連する問題