PPS*_*ein 15 css twitter-bootstrap twitter-bootstrap-3
我认为我想在bootstrap移动版本中隐藏网格中的一列是有点棘手的.让我们举个例子
<div class="row">
<div class="col-xs-9">
<p class="testimonial-about">"We have managed to received good number of applications through MyJobs in comparison to advertising in the newspaper and would recommend MyJobs to other companies to assist with their recruitment needs"</p>
</div>
<div class="col-xs-3 center-image hidden-xs"><img src="myimage.png"/></div>
</div>
Run Code Online (Sandbox Code Playgroud)
在编码之上,我在移动设备查看时隐藏图像部分.我想要的是我不想要图像部分的间距,即使它被隐藏为增加左边部分直到右边.
Siv*_*iva 26
因为,您将第二列隐藏在"xs"中,您可以通过将类"col-xs-12"定义为column1来使用第一列的全宽.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-xs-12 col-sm-9">
<p class="testimonial-about">"We have managed to received good number of applications through MyJobs in comparison to advertising in the newspaper and would recommend MyJobs to other companies to assist with their recruitment needs"</p>
</div>
<div class="col-sm-3 center-image hidden-xs"><img src="myimage.png"/></div>
</div>Run Code Online (Sandbox Code Playgroud)
Kje*_*din 11
如果您正在使用引导程序 4,和/或想要在除超小视图之外的任何内容上隐藏列,请按以下方法操作:
引导程序 3:
<div class="row">
<div class="col-lg-12 col-xl-9">
</div>
<div class="col-xl-3 hidden-lg hidden-md hidden-sm hidden-xs">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
换句话说,您必须定义要隐藏列的每个单独的预定义视口大小。
Bootstrap 4 :(少一点冗余)
<div class="row">
<div class="col-lg-12 col-xl-9">
</div>
<div class="col-xl-3 hidden-lg-down">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
此外,如果您想在屏幕太大时隐藏一列:
<div class="row">
<div class="col-md-12 col-sm-9">
</div>
<div class="col-sm-3 hidden-md-up">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
另请注意,col-xs-[n]已col-[n]在引导程序 4 中替换为
你必须使用的是媒体查询。
这是一个例子:
@media (min-width: 1000px) {
#newDiv {
background-color: blue;
}
.col-xs-3 {
display: block;
}
}
@media (max-width: 999px) {
#newDiv {
background-color: red;
width: 100%;
padding-right: 50px;
margin-right: 0px;
}
.col-xs-3 {
display: none;
}
}Run Code Online (Sandbox Code Playgroud)
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div id="newDiv" class="col-xs-9"><p>Hello World!</p></div>
<div class="col-xs-3"><p>Hello to you to</p></div>Run Code Online (Sandbox Code Playgroud)
使其全屏显示以查看屏幕响应
| 归档时间: |
|
| 查看次数: |
45963 次 |
| 最近记录: |