【发布时间】:2013-07-08 04:19:26
【问题描述】:
我正在用rails. 编写一个应用程序我对css 还不是很熟悉。虽然,我正在努力。还有一个问题,我生成的html标签是
<div class="sub-product post-1">
// content goes here
</div>
<div class="sub-product post-2">
// content goes here
</div>
<div class="sub-product post-3">
// content goes here
</div>
<div class="sub-product post-4">
// content goes here
</div>
现在,如您所见,post 排列了不同的数字。我试图做的是让他们缩进,这是我的 css
.sub-product.post-1 {
margin:30px
}
它有效,但如果我让它.sub-product.post-1.post-2.post-3.post-4 它确实显示缩进。我想我知道这里出了什么问题,但是显示它们缩进的优雅解决方案是什么?
谢谢
【问题讨论】:
标签: css css-selectors sass