Tutorial on bkjia.comAs you all know, add the following characters & amp; #13; (enter key, \ n) or & amp; #10; (newline key, \ r.
Run the following code to view the effect:
<Html>
Run codeCopy codeAdd to favoritesBkjia.com prompts that some code can be modified before running!
Can this method be used in all browsers? After testing, this method can only be searched on the Internet in ie (or chrome), firefox, And the w3c rules for title are found as follows:
Reference content is as follows:
The (X) HTML DTDs define the contents of the title attribute as CDATA for which the W3C states: User agents shoshould interpret attribute values as follows:
Replace character entities with characters,
Ignore line feeds,
Replace each carriage return or tab with a single space.
That is to say, only common characters can exist in the title, and all characters that can be converted into tags become common characters. Remove the line break symbol and convert the carriage return symbol into spaces. firefox follows this w3c principle, so there is no way to use this simple method to implement line breaks in firefox.