html - 在 bootstrap carousel 中定位元素

标签 html css twitter-bootstrap-3

我正尝试将一个向下的 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 类中 margin left 有效,但是当我尝试垂直移动 V 形时它没有做任何事情.. 正确的方法是什么?

最佳答案

你可以这样做:

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

CODEPEN

关于html - 在 bootstrap carousel 中定位元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33451464/

相关文章:

css - 移动设备(手机/平板电脑)和带有 CSS 媒体查询的 Bootstrap

html - Bootstrap 获取 div 居中对齐

html - 屏幕图像覆盖高度和粘性页脚固定

javascript - 我如何使用 JavaScript (jQuery) 按照惯例在 HTML 中创建一个元素的副本作为新元素?

javascript - 使用 d3 - 单击按钮时如何从数组中选择特定数据以突出显示?

html - 容器中固定和相对 div 的 z-index 问题

html - ng-hide 无法正常工作

html - 如何让我的 <ul> 悬停在同一个确切的位置开始?

javascript - 删除输入多个的选定文件名

javascript - D3.js 旋转垂直条形图标签