bootstrap 4 carousel caption在小型设备上不可见

我练习 http://v4-alpha.getbootstrap.com/examples/给出的bootstrap 4 carousal示例.在为移动设备或小屏幕测试时,看不到carousal标题.请帮忙.
<div id="myCarousel" class="carousel slide" data-ride="carousel">
 <ol class="carousel-indicators">
 <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
 <li data-target="#myCarousel" data-slide-to="1"></li>
 <li data-target="#myCarousel" data-slide-to="2"></li>
 </ol>
 <div class="carousel-inner" role="listBox">
 <div class="carousel-item active">
 <img class="first-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="First slide">
 <div class="container">
 <div class="carousel-caption d-none d-md-block text-left">
 <h1>Example headline.</h1>
 <p>Cras justo odio,dapibus ac facilisis in,egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
 <p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p>
 </div>
 </div>
 </div>
 <div class="carousel-item">
 <img class="second-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Second slide">
 <div class="container">
 <div class="carousel-caption d-none d-md-block">
 <h1>Another example headline.</h1>
 <p>Cras justo odio,egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
 <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>
 </div>
 </div>
 </div>
 <div class="carousel-item">
 <img class="third-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Third slide">
 <div class="container">
 <div class="carousel-caption d-none d-md-block text-right">
 <h1>One more for good measure.</h1>
 <p>Cras justo odio,egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
 <p><a class="btn btn-lg btn-primary" href="#" role="button">browse gallery</a></p>
 </div>
 </div>
 </div>
 </div>
 <a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
 <span class="carousel-control-prev-icon" aria-hidden="true"></span>
 <span class="sr-only">PrevIoUs</span>
 </a>
 <a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
 <span class="carousel-control-next-icon" aria-hidden="true"></span>
 <span class="sr-only">Next</span>
 </a>
 </div>

解决方法

从所有轮播字幕类中删除类d-none d-md-block,类d-none给标题显示none,类d-md-block为md及更高版本提供块显示屏幕.

注意:如果标题中包含大量文本,则可能需要在较小的屏幕上调整文本大小以使一切正常.

相关文章

Bootstrip HTML 查询搜索常用格式模版 &lt;form class=&...
如何在按钮上加红色数字 您可以使用Bootstrap的badge组件来在...
要让两个按钮左右排列,你可以使用 Bootstrap 的网格系统将它...
是的,可以将status设置为布尔类型,这样可以在前端使用复选...
前端工程师一般用的是Bootstrap的框架而不是样式,样式一般自...
起步导入:<linkrel="stylesheet"href="b...