CSS'content'属性中的换行字符序列? [英] Newline character sequence in CSS 'content' property?

查看:708
本文介绍了CSS'content'属性中的换行字符序列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在CSS content 属性中使用换行符字符强制换行符?例如:

  figcaption:before 
{
content:'图\\\
'+ attr标题);
}


解决方案

content 媒体资源接受 string 和:


字符串不能直接包含换行符。要在
字符串中包含换行符,请使用表示
ISO-10646(U + 000A)中换行符的转义,例如\A或\00000a。这个字符
代表CSS中newline的通用概念。


(不知道实际的浏览器支持。 / p>

Is it possible to use newline character in CSS content property to force a line break? Something like:

figcaption:before
{
    content: 'Figure \n' + attr(title);
}

解决方案

The content property accepts a string and:

A string cannot directly contain a newline. To include a newline in a string, use an escape representing the line feed character in ISO-10646 (U+000A), such as "\A" or "\00000a". This character represents the generic notion of "newline" in CSS.

(No idea about actual browser support.)

这篇关于CSS'content'属性中的换行字符序列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆