html圆圈里面有歌词,html – 设计文字,使其出现在线上方(歌词上方的和弦)

我希望能够使用CSS在音乐中的歌词之上显示和弦.这就是我真的喜欢它的样子:

C F

This line has a C chord, and it also has an F chord

使和弦变化显示在正确的地方.在HTML中,它看起来像这样:

CThis line has a C chord, and it also has an FF chord

我设法几乎得到了这种风格的效果:

.chord {

position: relative;

top: -1em;

}

但问题是它有差距:

C F

This line has a C chord, and it also has an F chord

如果只有width:0(我将使用overflow:visible)工作在一个内联的跨度.有没有人有解决方案?

编辑:谢谢@Kyle Sevenoaks.对于任何有兴趣的人来说,这是我的完整的CSS,它允许经文标注< p>,和弦标记为< span>以及是否显示和弦是否与父div上的show-chords类切换:

p.song span {

display: none;

}

p.song.show-chords p {

line-height:2.3em;

margin-bottom:2em;

}

p.song.show-chords span {

position: relative;

top: -1em;

display:inline-block;

width: 0;

overflow:visible;

text-shadow:#CCC -1px 1px;

color:#00F;

font-weight:bold;

font-family:Arial, Helvetica, sans-serif;

}

CThis line has a C chord, and it also has an FF chord

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值