html - Bootstrap 旋转木马标题不显示在全屏 1920 x 1080 中?

标签 html wordpress css twitter-bootstrap-3 carousel

我想弄清楚为什么 carousel-caption 不会显示在放大的 1920x1080 窗口中。如果窗口没有被炸毁,那么标题就可以正常显示。有问题的代码:

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner">

    <div class="item active">
      <img src="<?php echo get_bloginfo('template_directory');?>/img/banner-1.jpg" alt="Competitive Prices on Web Design, SEO, and Digital Marketing" />
      <div class="carousel-caption">
        <h3>Quality Web Design</h3>
        <p>Simple and Elegant Web Design, Located in Rochester Hills, Michigan</p>
      </div>
    </div>

    <div class="item">
      <img src="<?php echo get_bloginfo('template_directory');?>/img/banner-3.jpg" alt="Get Your Business Online Today" />
      <div class="carousel-caption">
        <h3>Get Your Business Online Today!</h3>
        <p> ... </p>
      </div>
    </div>

    <div class="item">
      <img src="<?php echo get_bloginfo('template_directory');?>/img/banner-2.jpg" alt="Drive Traffic to Your Site" />
      <div class="carousel-caption">
        <h3>SEO</h3>
        <p>Proper search engine optimization may make or break your website's visibility!</p>
      </div>
    </div>
  </div>

您可以在此处查看实际效果:http://foxpile.net/wordpress/

当我用主题之外的图像替换图像时(我使用了 http://placehold.it/1920x500 .. 一切似乎都正常工作)

我正在运行最新版本的 Wordpress 和 Bootstrap 3.2.0

最佳答案

当分辨率大于1280px时,在.carousel-caption中添加top: 46%;。这将解决问题,尝试使用代码检查器检查 firebug

在 bootstrap 中找到以下媒体查询,或者如果您要覆盖 Bootstrap CSS 而不是将其添加到覆盖的 css 文件中;

@media only screen and (min-width : 1200px) {
  .carousel-caption
  {
    top: 46%;
  }
}

在更大的分辨率下,向下移动的标题在顶部有更多的偏移量,并且由于容器溢出隐藏而不会显示。我对大于 1200px 的分辨率做了什么,我减少了字幕顶部偏移量。这使得它甚至可以在 1920x1080p 上显示。

祝你好运!

关于html - Bootstrap 旋转木马标题不显示在全屏 1920 x 1080 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24867673/

相关文章:

html - 在一些 HTML 标签中看到的 "generated"属性是做什么用的?

javascript - HTML5 Canvas 扇贝形状

javascript - 如何仅对 IE 应用 css 样式

javascript - 以最短显示时间加载屏幕

css - 使用 LESS 自定义样式

html - 如何添加溢出: hidden and max widths on images

wordpress - 利用浏览器缓存不起作用

html - 如何在不调整容器大小的情况下嵌入 Instagram 帖子

mysql - 问题让 docker 使用 wordpress 正确访问我的数据库

javascript - 在 javascript 上计算小费。我的代码有什么问题?