使用CSS3的ruby-position固定注音位置的用法示例

时间:2021-05-08

ruby-position 指定注意的位置时使用。<设置或检索通过rt对象指定的注释文本或发音指南(参考ruby对象)的位置。>

属性值
1.before注音文本会在基础文字上面表示。(默认值)
2.after注音文本会在基础文字下面表示。
3.right 注音文本会在基础文字右面表示。

实例代码

XML/HTML Code复制内容到剪贴板
  • <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • <htmlxmlns="http://www.w3.org/1999/xhtml">
  • <head>
  • <metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>
  • <title>ruby-position</title>
  • <style>
  • ruby.sample1{ruby-position:before;}
  • ruby.sample2{ruby-position:after;}
  • ruby.sample3{ruby-position:right;}
  • </style>
  • </head>
  • <body>
  • <p><rubyclass="sample1">新幹線<rt>しんかんせん</rt></ruby></p>
  • <p><rubyclass="sample2">新干线<rt>xinganxian</rt></ruby></p>
  • <p><rubyclass="sample3">高铁<rt>High-speedrail</rt></ruby></p>
  • </body>
  • </html>
  • 实例图

    声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

    相关文章