Analyze the question of line feed in title tags in HTML

Source: Internet
Author: User




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.




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.