【发布时间】:2019-04-02 03:36:15
【问题描述】:
我使用 jumbotron 在我的网站上的桌面版上拥有全高页面,但我希望在移动版上拥有正常布局(禁用 jumbotron)。因为在移动版本上,jumbotron div 内的内容会因为空间不足而向外流出。而下面的 div 内容与这些内容重叠。我正在使用 Bootstrap 4。我的代码如下,
<section class="jumbotron">
<div class="container">
<div class="content row">
<div class="col-12 jumbotron">
<div class="single-work">
<h2>Title here</h2>
<p>Text here</p>
</div>
</div>
</div>
</div>
</section>
【问题讨论】:
-
您不能“禁用”它,但您可以根据需要在移动设备上使用媒体查询来修改 CSS。
-
是的,您可以按照@IslamElshobokshy 的建议使用媒体查询来做到这一点。如需更多详细信息,请访问此处:w3schools.com/css/css_rwd_mediaqueries.asp
标签: html css bootstrap-4