CSS 内容属性中的换行符

对于在Speudo元素之前或之后:中生成的内容,css内容属性非常有用。要在该内容中插入新行/换行符,请使用\A转义字符:

1article h2::before {
2  content: "Killing \A Me \A Softly";
3  white-space: pre-wrap;
4}

空白属性

为了使新行正常工作,还需要将空白属性设置为预换行或预换行。

Published At
Categories with 技术
Tagged with
comments powered by Disqus