嘿,我想知道为什么会这样:
按钮不会填充容器,但锚点会填充。这两个标签在风格上有何根本不同?
<div class="table">
<a href="#">A</a>
<a href="#">B</a>
<a href="#">C</a>
</div>
<div class="table">
<button href="#">A</button>
<button href="#">B</button>
<button href="#">C</button>
</div>
.table {
display: table;
width: 100%;
outline: 1px solid red;
}
.table > * {
display: table-cell;
outline: 1px solid lightgreen;
}