<style type="text/css">
*{
margin:0;
padding: 0;
}
.parent{
width:100px;
height:100px;
background: green;
}
.child1{
width:30px;
height:30px;
background: red;
margin-top:10px;
font-size: 14px;
overflow: hidden;
}
</style>
<body>
<div class="parent"><div class="child1">我是第一个子元素</div>
<div class="child2"></div>
</div>
</body>
解决方案可参见博客http://www.cnblogs.com/lhb25/p/inside-block-formatting-ontext.html,通过讲述BFC我们可以有多钟解决方案。