【发布时间】:2013-08-30 20:43:04
【问题描述】:
我应该让 3 个divs 并排坐下。所以我创建了一个div 并放入了三个divs,使用这种css 样式:
div.holder div {
float: left;
width: 250px;
background-color: yellow;
/*margin-right:auto; /**These did not help**/
margin-left:auto; */
}
像这样的html:
<div class="holder">
<div></div>
<div></div>
<div></div>
</div>
它应该看起来像这样: 相反,它看起来像这样:
边框divs 应与灰线末端对齐。
【问题讨论】:
-
如果你想让你的“gold div”贴在右边,那就让它
float: right。 -
@Brewal 这是个好主意。现在,如果您知道一种将银色放在中间的方法,那我就完成了。也许我会试试
margin:auto。 -
以下线程正是您要查找的内容Fluid width with equally spaced DIVs
-
哦 - 对不起,我找不到要搜索的正确查询。
标签: css html css-float centering