【发布时间】:2016-08-17 23:36:50
【问题描述】:
经过长时间的休息后,我开始尝试使用 webdev,但无法弄清楚为什么 Figcaption 无法在 Safari 中正确显示。
我创建了网站 www.suezre.com,当在 Chrome 或 Firefox 中查看时,图片上的 figcaption 看起来不错,但在 Safari 上它需要更多空间。
有什么建议可以解决这个问题吗?
谢谢 回复
<figure>
<img src="../img/budapest_our_home_city.png"/>
<figcaption>Budapest, our home city</figcaption>
</figure>
figure {
position: relative;
}
figcaption {
position: absolute;
bottom: 0;
padding: 15px;
color: white;
background-color: rgba( 29, 20, 17, .6);
text-align: right;
text-transform: uppercase;
font-size: 1rem;
width: 100%;
}
.banner img {
max-width: 100%;
text-align: center;
display: block;
margin: auto;
}
【问题讨论】: