最佳答案
只需声明line-height
并设置 <a>
成为vertical-align: middle
.balloon{
background:url('http://i.imgur.com/B19Zb.jpg');
background-repeat: no-repeat;
text-align: center;
color:#fff;
font-size:1.1em;
height:140px;
width:140px;
line-height: 118px;
}
.balloon a{
vertical-align: middle;
color:yellow;
text-align:center
}
<div class="balloon">
<a href="#">Advertise with us</a>
</div>
关于html - 如何在背景 div 气球图像中居中放置文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7605485/