html - 我如何定位 bootstrap .container?

标签 html css twitter-bootstrap css-position

我正在尝试将内容 DIV 放置在 Bootstrap 轮播上。我很难弄清楚这一点。但我还是做不到。

这是我当前代码输出的截图。但这不是我想要的。

enter image description here

我想要的是,这个红色的 DIV 应该位于轮播的右侧。放置红色 DIV 时,它应该仍在 bootstrap .container 中以正确保持内容的宽度。

这是我到目前为止的标记 -

<div class="banner-content">
  <div id="homepage-feature" class="carousel slide">
      <ol class="carousel-indicators">
          <li data-target="#homepage-feature" data-slide-to="0" class="active"></li>
          <li data-target="#homepage-feature" data-slide-to="1"></li>
      </ol>

      <!-- Wrapper for slides -->
      <div class="carousel-inner">
        <div class="item active">
          <img src="http://lorempixel.com/1500/600/abstract">
          <div class="container">
              <div class="carousel-caption">
                 <h1>Changes to the Grid</h1>
                 <p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
              </div>
          </div>
        </div>
        <div class="item">
          <img src="http://placehold.it/1500X600">
          <div class="container">
              <div class="carousel-caption">
                  <h1>Percentage-based sizing</h1>
                  <p>With "mobile-first" there is now only one percentage-based grid.</p>
              </div>
          </div>
        </div>
    </div><!-- /.carousel-inner -->

            <!-- Controls -->
            <a class="left carousel-control" href="#homepage-feature" data-slide="prev">&lsaquo;</a>
            <a class="right carousel-control" href="#homepage-feature" data-slide="next">&rsaquo;</a>
  </div><!-- /#homepage-feature.carousel -->

  <div class="request-form-holder container"> 
      <div class="request-form">

      </div>
  </div>

</div>

JS FIDDLE用我目前的编码。

我期望的结果应该是这样的-

enter image description here

希望有人能帮帮我。谢谢。

最佳答案

检查这个fiddle

刚刚添加了float:right

在 CSS 中类 class="request-form"

这是你想要做的吗>

关于html - 我如何定位 bootstrap .container?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28761156/

相关文章:

javascript - 使用 jquery 从 javascript 获取 iframe 页面标题

php - getimagesize 不适用于包含拉丁/特殊字符的文件 PHP RHEL

html - Razor - HTML.RAW 不输出文本

jquery - 使用 jQuery 获取列表中的下一个或上一个项目

javascript - 如果父菜单有子菜单,则单击两次以转到链接,如果没有子菜单,则单击一次以链接

jquery - 使用 Jquery 的简单站点地图

php - 获取 google chrome 以查看 rss 提要

javascript - 尝试创建自定义 Bootstrap 导航栏

JQuery MagicLine 导航到下拉菜单

带有 Bootstrap 样式和响应式扩展的 jQuery DataTables 不起作用