我有一个div在另一个div内,我想要实现的效果是经典的三个产品图标彼此相邻,下方有一些解释性文字。div div内绝对定位和负边距重叠内容
文本div的内容不会压低以下内容并与其重叠。我已经尝试了许多不同的解决方案,但是在这种情况下我没有找到任何可行的方法
恐怕内部div的绝对定位和负边缘会让它更难。
我将不胜感激任何建议。谢谢!
HTML
<div class="icon-group">
<div class="icon">
<i class="fa fa-book fa-4x" aria-hidden="true"></i>
<div class="icon-caption">Astonishment tendrils of gossamer clouds the carbon in our apple pies made in the interiors of collapsing stars.</div>
</div>
<div class="icon">
<i class="fa fa-plane fa-4x" aria-hidden="true"></i>
<div class="icon-caption">Astonishment tendrils of gossamer clouds the carbon in our apple pies made in the interiors of collapsing stars.</div>
</div>
<div class="icon">
<i class="fa fa-quote-right fa-4x" aria-hidden="true"></i>
<div class="icon-caption">Astonishment tendrils of gossamer clouds the carbon in our apple pies made in the interiors of collapsing stars.</div>
</div>
</div>
<div class="clear"></div>
<h3 class="after-icons">What people say about me</h3>
CSS
.icon-group, icon-caption-group {
height: 100px; display: table; width:100%; table-layout: fixed}
.icon, .icon-caption {
display: table-cell;
text-align: center;
vertical-align: middle;
position: relative;}
.icon-caption {
border-bottom: 3px solid #E8EAF6;
vertical-align: middle;
position: absolute;
top: 50%;
left: 50%;
width: 50%;
margin: -15% 0 0 -25%;
margin-top: 20%;
}
.after-icons {
margin-top: 30px
}