跳到主要內容

字串不得有換行符

禁止字串中出現無效的換行符。

a {
content: "first
second";
}
/** ↑
* The newline here */

說明中提到:「字串無法直接包含換行符。若要在字串中加入換行符,請使用表示 ISO-10646 中換行字元的跳脫字元(例如「\A」或「\00000a」)。此外:「可以將字串分行,以符合美觀或其他理由,但這種情況下,換行符本身必須使用反斜線(\)進行跳脫。」

選項

true

下列模式被視為問題

a {
content: "first
second";
}
[title="something
is probably wrong"] {}
a {
font-family: "Times
New
Roman";
}

下列模式被視為問題

a {
content: "first\Asecond";
}
a {
content: "first\\nsecond";
}
[title="nothing\
is wrong"] {}
a {
font-family: "Times New Roman";
}