Html 容器流体未居中
我只想让我的列居中,但右边的空间太大,左边没有空间Html 容器流体未居中,html,css,twitter-bootstrap,twitter-bootstrap-3,Html,Css,Twitter Bootstrap,Twitter Bootstrap 3,我只想让我的列居中,但右边的空间太大,左边没有空间 <div id="about" class="pad-section"> <div class="container-fluid"> <h1 style="text-align:center;">COMPANIES</h1> <div class="row-fluid" style="margin: 150px 0 100px 0;"> <div
<div id="about" class="pad-section">
<div class="container-fluid">
<h1 style="text-align:center;">COMPANIES</h1>
<div class="row-fluid" style="margin: 150px 0 100px 0;">
<div class="col-lg-4">
<div class="ih-item square effect6 from_top_and_bottom"><a href="#">
<div class="img">Image with hovering effect</div>
<div class="info">
<h3>Title</h3>
<p>Description</p>
</div></a></div>
</div>
<div class="col-lg-4">
<div class="ih-item square effect6 from_top_and_bottom"><a href="#">
<div class="img">Image with hovering effect</div>
<div class="info">
<h3>Title</h3>
<p>Description</p>
</div></a></div>
</div>
<div class="col-lg-4">
<div class="ih-item square effect6 from_top_and_bottom"><a href="#">
<div class="img">Image with hovering effect</div>
<div class="info">
<h3>Title</h3>
<p>Description</p>
</div></a></div>
</div>
</div>
</div>
</div>
公司
您需要将.container fluid
更改为.container
并将.row fluid
更改为.row
更新OP评论:
谢谢,但我的问题是,这些栏目离我们太近了 即使我加了填充物,你们也能互相帮助吗 您必须为我不得不使用的列重写
填充
(不要使用!important
),因为代码段不起作用,请为填充
设置您更喜欢的值
而且它不是集中在较小的屏幕上
要对齐中心,请使用引导类文本中心
注意:加上我使用了col-xs-4
,但仅用于演示,如果您只想有一列,请使用col-xs-12
或col-sm-12
[class*=“col-”]{
填充:0 50px!重要
}
公司
您的HTML错误<代码>嗯?你的HTML很好。这就是流体容器的工作原理,它们占据了页面宽度的100%。这是代码的预期结果。如果要使其居中,请拆下流体容器。@APAD1如何使其居中(@PraveenKumar lol我刚才看到了,谢谢你指出了这一点,但仍然没有解决我的问题?将容器流体
更改为容器
,然后它将有一个设定的宽度,并将在页面上居中:谢谢你,但我的问题是,即使在我添加填充物时,列之间也太近了?只有三个:)最小的一个screen@NikitaLim,请参阅更新的答案,您必须像我一样覆盖列的填充(不要使用!important
),因为代码段不起作用,所以我必须使用,请为填充设置您更喜欢的值。要对齐中心,请使用引导类text center
,加上我使用的col-xs-4
,但仅用于演示,如果您只想使用一列,请使用col-xs-12
或col-sm-12
谢谢!我把百分比改为80%,他们分散开来,但现在他们不在中心什么百分比?你能给我拿把小提琴吗?你运行我的代码片段了吗?