<div class="marker m2">
<span class="hint--top" data-hint="Here is a marker with more text!">
<div class="inner-marker"></div></span></div>
上面的代码不允许在“data-hint”文本中使用换行符。我在break标签上尝试了不同的变化,但它仍在我的句子中显示。不会发生换行。
答案 0 :(得分:2)
.hint--top::after {
content: attr(data-hint);
white-space: pre-wrap;
}
&#13;
<div class="marker m2">
<span class="hint--top" data-hint="Here is a marker
with more text!">
<div class="inner-marker"></div></span></div>
&#13;