pin*_*ngu 5 html css wordpress carousel twitter-bootstrap-3
我想弄清楚为什么 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>
Run Code Online (Sandbox Code Playgroud)
你可以在这里看到它的实际效果:http : //foxpile.net/wordpress/
当我用主题之外的图像替换图像时(我使用了http://placehold.it/1920x500 .. 一切似乎都正常工作)
我在最新版本的 Wordpress 和 Bootstrap 3.2.0 上运行
添加大于top: 46%;的.carousel-captionwhile 分辨率1280px。这将解决问题尝试使用代码检查器(如firebug等)进行检查。
在 bootstrap 中找到以下媒体查询,或者如果您要覆盖 Bootstrap CSS,而不是在覆盖的 css 文件中添加它;
@media only screen and (min-width : 1200px) {
.carousel-caption
{
top: 46%;
}
}
Run Code Online (Sandbox Code Playgroud)
在更大的分辨率下,标题向下移动病房在顶部有更多的偏移,并且由于容器而不显示overflow hidden。我在分辨率上所做的比1200px我减少了标题顶部偏移。这使它显示在 even 上1920x1080p。
祝你好运!