Html 全力以赴<;部门>;s在a<;部门>;10像素的边缘底部

Html 全力以赴<;部门>;s在a<;部门>;10像素的边缘底部,html,css,Html,Css,如何在命名的中给出所有的,边距底部:10px而不是给每个人一个边距底部:10px 我有: <div class="main"> <div>1</div> <div>2</div> <div>3</div> //How can I give these 3 a margin-bottom:10px; </div> 1. 2. 3//我怎样才能给这3个底限:10px; 我做了:.main di

如何在命名的
中给出所有
边距底部:10px而不是给每个人一个
边距底部:10px

我有:

<div class="main">
 <div>1</div>
 <div>2</div>
 <div>3</div> //How can I give these 3 a margin-bottom:10px;
</div>

1.
2.
3//我怎样才能给这3个底限:10px;
我做了:
.main div{margin bottom:10px;}
但这不起作用。

简单,在css中:

.main div{
    margin-bottom: 10px;
}

呃,你的解决方案有效。检查是否有其他样式规则应用于您的元素。您的解决方案正是我所做的,但我想知道为什么我的不起作用!OP已经在他的问题中使用了这个。还有别的问题。也许是打字错误什么的。