I want to use a carriage return in attribute title. And I have this HTML code:
<a href="javascript:;" title="Line 1 
Line 2">Link Text</a>
But Nu Html Checker throws the error:
【Error】 A numeric character reference expanded to carriage return.
Also tried to use 
, but got the same error.
I want to resolve this error, what can I do?

 and 
 are numeric character references which escape the Unicode control character "CARRIAGE RETURN" (per UnicodeData.txt).
In HTML, text (as in attribute values) must not contain control characters (other than space characters):
The numeric character reference forms described above are allowed to reference any Unicode code point other than […] control characters other than space characters.
According to the linked definition, "CARRIAGE RETURN" isn’t a space character.
If you want a line break, you can use /
, which escape the Unicode control character "LINE FEED", but this one is defined to be a space character, so it’s allowed in text.
<a href="javascript:;" title="Line 1 Line 2">Link Text</a>
<a href="javascript:;" title="Line 1
Line 2">Link Text</a>
From the definition of the title attribute:
If the
titleattribute’s value contains U+000A LINE FEED (LF) characters, the content is split into multiple lines. Each U+000A LINE FEED (LF) character represents a line break.
Note that you could also add a line break like this:
<a href="javascript:;" title="Line 1
Line 2">Link Text</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With