我正在制作一个站点并使用 bootstrap 3.3.5。我目前遇到的唯一问题是我的行/列结构在移动设备上显示不正确。
这是元素的链接:https://foreverfightermovie.herokuapp.com/#/home
到目前为止,它在计算机浏览器上看起来不错,但在移动设备上,丝带堆叠在中间面板部分上。这是我正在使用的 html:
<div class="jumbotron">
<h3 class="text-right" style="margin-right: 100px"> Production status: <b>Pre-Production</b> </h3>
<h1 class="text-center">The official site of <h1>
<div class="container">
<div class="row">
<div class="col-md-3">
<img src="/images/breast-cancer-ribbon.png" width="200" height="400" style="margin-left: 30px"/>
</div>
<div class="col-md-6">
<div class="panel-body text-center px-font" style="background-color: pink">
<br><b><FONT FACE="Lucida Console">FOREVER<br>FIGHTER</FONT></b><br><br>
<h3><i>"In life you can fight forever, but you can't live forever. One is a choice and the other is a guarantee"</i><h3>
</div>
</div>
<div class="col-md-3">
<img src="/images/breast-cancer-ribbon.png" width="200" height="400"/>
</div>
</div>
</div>
<br>
<p class="text-center"><a class="btn btn-primary btn-lg text-center" style="color: #2BDE73">
<img src="/images/kickstarter-logo.png" width="30" height="30"/>
Click for Donation Pledges</a></p>
</div>
此外:这是我正在使用的 css:
.tab { margin-left: 20px;
margin-right: 20px; }
.imagetab { margin-left: 40px;
margin-right: 40px;}
.para {
text-indent: 40px;
}
.jumbotron {
margin-left: 30px;
margin-right: 30px;
}
html {font-size: 90%;}
div.px-font {
font-size: 110px;
}
有人对如何修复它有任何建议吗?
最佳答案
Bootstrap 的优势在于堆叠,但您可以在自定义 CSS 中覆盖任何您想要的内容。对于您想执行的操作,我会使用带有 Bootstrap 内置断点的媒体查询。这是一个简单的例子:
@media (max-width: @screen-sm-min) {
/* This is the row containing your main panel and two ribbon divs. */
.main-row {
position: relative;
}
/* Add this to each of your ribbons. The ".left" & ".right" are self-explanatory. */
.ribbon {
position: absolute;
top: 100px;
}
.ribbon.left { left: 0px; }
.ribbon.right { right: 0px; }
/* Resize your images here to fit as you'd like them. */
.ribbon img {
height: 100px;
width: 50px;
}
}
您可以在此处找到有关 Bootstrap 提供的查询的更多信息:http://getbootstrap.com/css/#grid-media-queries
关于html - 使用 bootstrap for mobile 中的行和列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31373156/