http://elosource.herokuapp.com/
如您在我的测试页面上所见,内容在左侧站点中对齐。我想把它放在中间。
虽然我读过 http://www.w3.org/Style/Examples/007/center.en.html但由于某种原因它没有工作。
我的内容是这样的
<div class="content">
<div class="row">
<div class="span">
<img src="http://placehold.it/180x1200">
</div>
<div class="span12">
@content
</div>
<div class="span">
<img src="http://placehold.it/180x1200">
</div>
</div>
</div>
还有我的CSS:
.content {
background-color: #fff;
display: block;
margin-left:auto;
margin-right: auto;
最佳答案
您还应该在 .content 上设置宽度。像这样:
.content {
margin: 0 auto;
width: 1340px;
}
在 chrome inspector 中试过,效果很好...
关于html - Twitter Bootstrap - 居中内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12026807/