我基本上有以下HTML/CSS:如何将图像放置在按钮元素中的文本下方?
.actionButton .parent {
display: table;
}
/*try to put image at the bottom*/
.actionButton img.bottom {
display: table-footer-group;
}
/*try to put div tag containing text on top*/
.actionButton .top {
display: table-header-group;
}
<div class="actionButton section">
<button class="parent">
<img class="bottom" src="//dummyimage.com/100">
<div class="top">Click me!</div>
</button>
</div>
如果按钮被替换div标签,然后在给定的CSS将正确地使文本显示上述格式的组图片。无法重现该按钮。任何人都可以解释为什么,或者如何解决?
我不明白这是嘛? http://jsfiddle.net/h67j73rt/2/ – imGaurav
大声笑。它看起来是正确的,但是元素的顺序在你的代码中得到了体现。我希望他们按照我定义的顺序排列,即img在div之前。 –