我有两个未嵌套的div,一个在另一个之下。它们都在一个父div内,并且该父div重复其自身。所以本质上:
<div id='parent_div_1'> <div class='child_div_1'></div> <div class='child_div_2'></div> </div> <div id='parent_div_2'> <div class='child_div_1'></div> <div class='child_div_2'></div> </div> <div id='parent_div_3'> <div class='child_div_1'></div> <div class='child_div_2'></div> </div>
我想每对child_div_1以及child_div_2彼此相邻。我怎样才能做到这一点?
child_div_1
child_div_2
width: 100px; height: 100px; border: 1px solid red; margin-right: 10px; float: left; } .child_div_1 { float: left; margin-right: 5px; }