【问题标题】:Positioning elements inside bootstrap carousel在引导轮播中定位元素
【发布时间】:2016-01-31 19:01:14
【问题描述】:

我正试图在我的转盘上放置一个向下的 V 形,但 V 形出现在转盘容器之外。我想要这样的东西:

http://www.yummygum.com

我的 HTML 代码:

<div id="myCarousel" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img class="img-rounded" src="images/biz%20bznner.png" alt="First slide">
      <div class="container ccontainers">
        <div class="carousel-caption">
          <h1 class="animated rubberBand 1">You have a project? Let Us Do it for you</h1>
          <h3 class="animated bounceInLeft">We will do your projects with the best prices</h3>
          <p><a class="btn btn-lg btn-primary animated shake 1" href="#" role="button">Sign up today</a></p>
        </div>
      </div>
    </div>
  </div>
  <a class="chevron-down" href="#myCarousel" role="button">
    <span class="glyphicon glyphicon-chevron-down" aria-hidden"true"></span>
  </a>

</div>

我的 CSS:

.carousel-control.right, .carousel-control.left {
background-image: none;
}

.carousel .item {
    height: 100vh;
    margin-bottom: 60px;
}

.carousel {
  height: 100vh;
  width:100%; 
}


.carousel-caption {
  z-index: 10;
  margin-top: 0%;
  margin-bottom: 5%;
}

.carousel-caption h3 {
    padding: 0.5em;
    animation-delay: 0.5s;
}

.chevron-down{
    **margin-bottom:100px** //THIS DOES NOT WORK
    margin-left: 50%;
    font-size: 30px;
}

.carousel-caption a{
    background-color: orangered;
    border-color: darkred;
    margin-top: 1em; 
    animation-delay: 2s;
}

.carousel-caption h1 {
  text-align: center;  
  margin-bottom: 30px;
  font-size: 30px;
  font-weight: bold;
  animation-delay: 0s;
}

.carousel-inner > .item > img {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  height: 100vh;
}

所以在 .chevron-down 类中的左边距有效,但是当我尝试垂直移动 V 形时它什么也没做......这样做的正确方法是什么?

【问题讨论】:

    标签: html css twitter-bootstrap-3


    【解决方案1】:

    你可以这样做:

    .chevron-down {
      font-size: 30px;
      position: relative;
      bottom: 100px;
    }
    

    CODEPEN

    【讨论】:

      猜你喜欢
      • 2012-11-25
      • 1970-01-01
      • 2014-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-18
      • 2015-07-16
      • 1970-01-01
      相关资源
      最近更新 更多