こういう感じのスタイルシートを当てておいて, pre.code { position: relative; } pre.code[data-lang-label]::before { content: attr(data-lang-label); font-family: 'Helvetica Neue', 'Helvetica', 'Arial', 'Hiragino Kaku Gothic Pro', 'Meiryo', 'MS PGothic', sans-serif; font-style: italic; position: absolute; top: 0; right: 0; background-color: #FFFFFF; border-radius: 0 0 0 4px; padding: 0 7px; } pre.code[data-lang-label]:hove