Twitter bootstrap 无法在引导过程中使流体容器内的3列完全居中
我试图居中3列,每个insisde a流体容器中的偏移量为1,但由于某些原因,所有3列都是左对齐而非右对齐的 另外,当我调整窗口大小时,所有3列都向左移动,而不是保持居中 我的问题是:Twitter bootstrap 无法在引导过程中使流体容器内的3列完全居中,twitter-bootstrap,css,twitter-bootstrap-3,containers,col,Twitter Bootstrap,Css,Twitter Bootstrap 3,Containers,Col,我试图居中3列,每个insisde a流体容器中的偏移量为1,但由于某些原因,所有3列都是左对齐而非右对齐的 另外,当我调整窗口大小时,所有3列都向左移动,而不是保持居中 我的问题是: <div class="container-fluid conle"> <row> <div class="col-md-3 col-md-offset-1 col-sm-8 col-sm-offset-1 workscol">
<div class="container-fluid conle">
<row>
<div class="col-md-3 col-md-offset-1 col-sm-8 col-sm-offset-1 workscol">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Everything</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell
and makes you got fetch it. Thank you for your patience. Have a treat</p>
</div>
<div class="col-md-3 col-md-offset-1 col-sm-8 col-sm-offset-1 workscol">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Control Nothing</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell
and makes you got fetch it. Thank you for your patience. Have a treat</p>
</div>
<div class="col-md-3 col-sm-8 col-sm-offset-1 workscol">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Go Away</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell
and makes you got fetch it. Thank you for your patience. Have a treat</p>
</div>
</row>
</div> <div class="clear"></div>
以图像、标题、文本和图片为中心的最佳方式是什么
引导中的列注意:无论屏幕宽度如何,我都希望所有项目都居中
HTML:
<div class="container-fluid conle">
<row>
<div class="col-md-3 col-md-offset-1 col-sm-8 col-sm-offset-1 workscol">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Everything</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell
and makes you got fetch it. Thank you for your patience. Have a treat</p>
</div>
<div class="col-md-3 col-md-offset-1 col-sm-8 col-sm-offset-1 workscol">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Control Nothing</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell
and makes you got fetch it. Thank you for your patience. Have a treat</p>
</div>
<div class="col-md-3 col-sm-8 col-sm-offset-1 workscol">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Go Away</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell
and makes you got fetch it. Thank you for your patience. Have a treat</p>
</div>
</row>
</div> <div class="clear"></div>
请记住,我对bootstrap还比较陌生,但是在一个教程之后,上面的代码是我能做的最好的了。所以请务必解释我做错了什么。谢谢!这就是你想要的吗
HTML:
您需要指定最大宽度有什么原因吗?这就是您想要的吗
HTML:
是否有需要指定最大宽度的原因?部分答案是这样的,但列在代码中没有完全居中。这些列被放置在更左侧,而不是在页面上完全居中。“我正在尝试在流体容器中居中3列,每列的偏移量为1。”“--这就是为什么他们没有完全居中。。如果希望它们在每个容器中完全居中,则需要删除偏移,即
col-md-offset-1
和col-sm-offset-1
。或者,如果您希望集中整个页面中的三个部分,同时仍保持每个部分中的偏移量,则需要创建一个容器。此外,如果要完全删除偏移量,您可能希望将类分别更改为col-md-4
和col-sm-4
(因为有3个部分,引导使用12列网格规则)。最大宽度实际上是用来保持文本段落的短。那么我该如何设置它?太好了,这正是我想要的。谢谢!这是部分答案,但列在代码中没有完全居中。这些列在页面上的位置更左,而不是完全居中。“我试图将流体容器内的3个柱居中,每个柱的偏移量为1"--这就是它们没有完全居中的原因。如果希望它们在每个容器中完全居中,则需要删除偏移量,即col-md-offset-1
和col-sm-offset-1
。或者,如果希望将整个页面中的三个部分居中,同时仍保持每个部分中的偏移量,则需要创建一个容器。此外,如果要完全删除偏移量,您可能希望将类分别更改为col-md-4
和col-sm-4
(因为有3个部分,引导使用12列网格规则)。最大宽度实际上是用来保持文本段落的短。那么我该如何设置它?太好了,这正是我想要的。谢谢!
<div class="container-fl
uid conle">
<row>
<div class="col-md-3 col-md-offset-1 col-sm-8 col-sm-offset-1">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Everything</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell and make you go fetch it. Thank you for your patience. Have a treat,</p>
</div>
<div class="col-md-3 col-md-offset-1 col-sm-8">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Everything</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell and make you go fetch it. Thank you for your patience. Have a treat,</p>
</div>
<div class="col-md-3 col-md-offset-1 col-sm-8">
<img src="http://jsfiddle.net/img/logo.png" height =100px; alt="">
<h2>Everything</h2>
<p class="text-muted textworks">Sign up and shut up or i will pick a 10 pound dumbell and make you go fetch it. Thank you for your patience. Have a treat,</p>
</div>
</row>
</div>
.textworks {font-size:20px; }
.conle {text-align:center; }