我有一个非常简单的代码:
<div>
<div>
<div>Topic</div>
<div>Sub Topic</div>
</div>
<div>
<div>test 1</div>
<div>Test 2</div>
</div>
</div>
但我想让“test 1”出现在主题的右边。现在它出现在下面。有没有办法用 CSS 解决?
最佳答案
<div>
<div style="float:left;width:200px;">
<div>Topic</div>
<div>Sub Topic</div>
</div>
<div style="float:left;width:200px;">
<div>test 1</div>
<div>Test 2</div>
</div>
<div style="clear:both;"></div>
</div>
关于html - 让我的 DIV 对齐似乎很难,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6112783/