这是我要进行的更改:
- 放置
span
usingbottom
而不是top
,因此您始终在跨度和图像底部之间有特定的边距。 - 使用基于百分比的值,
line-height
以便它会与font-size
- 在跨度的右边添加一些填充,这样文本就不会在跨度的边缘向上碰撞
更新的CSS:
.herotext span { position: absolute; bottom: 20px; font-family: 'museo_slab500'; font-size: 150%; color: #fff; padding: 0 20px; width: 40%; line-height: 150%; background: rgb(0, 0, 0); background: rgba(0, 0, 0, 0.7);}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)