Change Font Size:

XHTML Tutorial - text formatting and special characters

This section presents text formatting and special characters in the method XHTML.

The handbook after more closely linked, we recommend that you read from the first quarter onwards.

Text formatting tags

In the handbook before, we have used a <b> labels, he makes it included in the contents of a bold show. For example, "NT22 <b> </ b>" will be shown as NT22. Putting this definition of the label text display text format called tags (text style labels...). With bold labels <b> italics are similar labelling <i> and the importance of such labelling <em>. We recommend you use CSS style definition of the website, rather than the similar <b> XHTML labels, here is the purpose of these labels so that you can read the source code of pages others when not confused.

Special characters (characters entity)

In XHTML "<" and " />" is a special character, as they are used for identification label, but the label of "<" and " />" and will not appear in the pages. So if we want to show these special characters, how to do this? Then we can use character entities, such as less than "<" XHTML code is written "<." Of course, in the web-design software, we do not need this work to complete handwritten code. So as long as we understand these special characters can be displayed principle, without the need to remember that every one of the special characters to write code.

Practice examples

Use Notepad to open before the creation of the "index.html" document. The source file amended to read (red tips), preserved after look at what the difference before, please make sure your Web pages with the same.

 no </b>Guarantee that there is nothing wrong, Cold summer and write operations (mathematics <b> not </ b> assurance that there is nothing wrong, 
四年级</b>以下同学, <b>特体须加收费用</b> Language does not guarantee that there Xizi, English operations you find others bar) <br /> help bully <b> fourth grade </ b> The following students, <b> special body should be subject to cost </ b>. 冒充家长</i> 。 <br /> Parents will help <i> posing as parents </ i>. </ P ><!-- above is the content of a paragraph ->

Below practice to use another character entities. Preservation of open before "index.html" In "/ body> tag before entering the following code:

  <p> Copyright © Copyright 2005-2006nt22.com not </ p> 

Save and re-visit the website can be seen on the following contents:

"Copyright © 2005-2006XXX no copyright." We note that the source code for the "©" displayed in a browser. "@." Please confirm your page again with the same pages completion.

On the order of labels

Xue finished text formatting tags you may want to, if I want a word at the same time to show that the bold and italic how do? Is not a simple addition to its double-labelling <b> and <i>? Yes. Look at this example:

  <b> <i> I was surrounded by two labels!  </ I> </ b> 

Will be displayed in a browser. As I was surrounded by two labels!

Here you only need to pay attention to the label in the order. If you will be written in the above sequence tags <b> <i> I was surrounded by two labels! </ B> </ i>, the average browser will not produce any errors. But this is not in line with XHTML standards on the wording. You must shut down in accordance with the sequence tags.

Enter the next section: XHTML Tutorial - hyperlinks