<ul style="background: blue; list-style: none; width: 40px; height: 40px; color: white">
<li style="float: left; width: 20px; background: red">a</li>
<li style="float: left; width: 20px; background: green; height: 40px">b</li>
</ul>
那一点 HTML / CSS 似乎产生了一个 80px 宽的 ul,而不是 40px 宽。我不确定为什么。有任何想法吗?这是小提琴:
谢谢!