This section introduces the implementation methods of text format and extraordinary characters in XHTML.
In the previous tutorial we used the <b> tag once, which made the content contained in it appear in bold. For example, <b>Rookie Bar</b> will be displayed as a rookie . We call this label that defines the way of text display a text format label (text style label...). Similar to bold labels, there are also italic labels and emphasizing labels. We recommend that you use CSS to define the style of web pages instead of <b>XHTML tags. The purpose of introducing these tags here is to prevent you from being confused when reading the source code of other people's web pages.
< and > are more extraordinary characters in XHTML because they are used to identify tags, and < and > in tags do not appear on the page. So what if we want the browser to display these extraordinary characters? At this time, we can use character entities, such as less than the sign < and write it as < in XHTML code. Of course, in web design software, this work does not require us to write code to complete. Therefore, we only need to understand the display principle of these extraordinary characters, without remembering the writing code of each extraordinary character.
Use Notepad to open the previously created index.html file. Make the following modifications to the source file (red letter prompt). After saving, see what the differences are before and after. Please confirm that your web page is the same as this page.
Writing winter and summer homework (Mathematics <b> No </b> guarantees no wrong questions, Chinese language does not guarantee no wrong words, you should find someone else in English homework)
<br />Help bully students below the fourth grade </b> , and the special physical education must be charged additional fees .
<br />Parents' meeting to help <i> impersonate parents </i> .
</p><!--The above content is a paragraph-->
Let’s practice using character entities. Open the index.html you saved before and enter the following code before the </body> tag:
<p>Copyright©2005-2006cainiao8.com has no copyright</p>Save and modify and browse the web page again and you will see the following content:
Copyright©2005-2006XXX No copyright. We focus on the © in the source code to display as @ in the browser. Please confirm again that your web page is the same as this page and is completed.
After learning the text format tag, you may think, what if I want a word to be displayed in bold and italics at the same time? Is it simply to add double-layer labels to it? That's right. Please see the following example:
<b><i>I am surrounded by two tags! </i></b>
It will be displayed in the browser as I am surrounded by two tags!
The only thing you need to pay attention to here is the order of labels. If you write the above label order as <b><i>I am surrounded by two labels! </b></i>, ordinary browsers will not generate any errors. But this is not in line with the XHTML standard. Please be sure to close the tags in order.