有没有办法为DIV保留设置的宽度/高度,并且在不增加DIV的情况下填充内容?参见下面的例子.我想要所有的盒子正好是140×140.
HTML:
<div class="Box1">Howdy.</div> <div class="Box2">Howdy.</div> <div class="Box3">Howdy.</div>
CSS:
.Box1 { width: 140px; height: 140px; background: #f66; } .Box2 { width: 140px; height: 140px; background: #66f; padding: 1em; } .Box3 { width: 140px; height: 140px; background: #6f6; border: 1em solid #000; }