Learning web standards: special characters in Web standards

Source: Internet
Author: User

When I first learned the web standard, there was one:

Encode all <and & special characters:
Any minor sign (<), not part of the tag, must be encoded as & l t; any major sign (>), not part of the tag, must be encoded as & g t;
Any ampersand (&), not part of an object, must be encoded as & a m p;
Note: There is no space between the above characters.

We often encounter this situation in our daily work:

More>

Most of their counterparts in China write two big Yu numbers & gt; or simply write> (more exaggerated is that some people use separately to pursue the same effect ), A more reasonable statement is as follows:

<Style> a: after {content: '\ 00BB' ;}</style> <a href = ""> more </a>

\ 00BB-right double angle quote, unicode = & raquo ;(»)

Because IE6/7 does not support the after pseudo-class, it is good to write the following code in the first step:

<A href = ""> More & raquo; </a>

Display Effect:

More»

The best example is the path in the lower left corner of the wordpress Editor:

While the breadcrumb navigation area is often written as a greater sign than & lt; instead, it should be & rsaquo; according to the title statement in the wordpress Background:

<Title> Add a new article & lsaquo; 99css & #8212; WordPress </title>

The display effect is as follows:

Add a new article named ‹ 99css-WordPress

Change the l of & lsaquo; to r.

In addition, aoao and Xiaofei discussed spaces on twitter. Xiaofei said:

The test shows that the space is still represented by \ u0020, which indicates the best compatibility and semantics.

I don't quite agree. My point is: Using & nbsp; in html, while using \ 20 in css is more reasonable: p

Additional reading

  • Using HTML Symbol Entities Chinese Translation: Use HTML character entity
  • Character Entity Reference HTML 4
  • Character reference and white space characters

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.