|
Raw HTML tags, such as the <, >, and & may need to be displayed in a browser. Since browsers read those characters as HTML tags, there are special ways to display those characters. This chapter will show those special characters, and how to use clean code to communicate with other designers, or those that may come behind you. These are called character entites.
How do I use a less than or greater than tag inside my web page?
Since HTML tags use characters that are used by the HTML tags, you can convert those tags into clean code tags, so browsers such as Internet Explorer and Netscape read the tag as a greater than or less than tag, and not as a tag that is suppose to be hidden. Here is an example:
10 > 5
To write this tag, you would use special characters in place of the actual symbol. All cahracter entities start with an ampersand ( & ) and end with a semicolon( ; ). The greater-than symbol would be ( gt )(short for Greater Than).
The actual HTML is:
10 > 5
11 < 20
Here, the HTML is:
11 < 20
Notice that the character entites do not get placed inside the HTML containers! <>
How do I use spaces inside my HTML page?
Spaces can be "hard coded" inside your HTML page. As you may have seen by now, "white space", or blank space is not translated into space when viewing an HTML page, thus if you need to hard code spaces inside your HTML page, there is a special tag that can be used.
This is a tab. This is another tab.
The code: This is a tab. This is another tab.
How do I use an ampersand and double quotes inside my HTML page?
Double quotes and ampersands can also be hard coded. These tags look like this...
I spoke to Sally and she said, "Bobby likes soup & salad."
The code:
I spoke to Salley and she said, "Bobby likes soup & salad."
Can I put copyright tags inside my website and other comments that people can't see?
Most Internet websites are business websites. Thus, most of their data, web design, etc., can be copyrighted. The copyright sign (©) can be displayed at the bottom of the page by the following tag:
Copyright © AIT, Inc.
The code: Copyright © AIT, Inc.
Another tag that people often use when coding HTML by hand in an ASCII text editor is the comment tag. Comment tags allow for good communication to others inside the code, without having all people that access the HTML page see it. Thus, web designers can communicate between one another, or one web designer can leave marks to organize tables, or areas that may be changed alot. The following is an example of a comment...
<!-- Text goes here -->
Listed below are the special characters that can be added to your web pages.
|
Opening HTML Tag |
Explanation of Tag |
| < |
Less than tag. (<) |
| > |
Greater than tag. (>) |
| |
Blank Space tag. ( ) |
| < |
Hard coded space. |
| & |
Ampersand tag. (&) |
| amp;quot; |
Double quote tag. (") |
| © |
Copyright tag. (©) |
| <!-- comment --> |
The word "comment" can be replaced with any comment that may be desired. |
|
Try it yourself. Put these lines in the Text Box provided, and see what the HTML tags you have learned will do to an HTML page.
<html>
<head>
<title>Chapter 8</title>
<meta name="keywords" content="altavista, excite, hotbot, lycos, webcrawler, google, website ranking, search engine promotion">
<meta name="description" content="How to increase your website ranking in the search engines">
</head>
<body bgcolor="#000000" text="#FFFFFF" link="#FF0000" vlink="#3333FF" alink="#FFCC00">
<h1>Special Characters</h1><br>
4 > 2<br>
7 < 10<br>
This line is " tabbed in "<br>
<!-- This is a comment that will not be displayed in the browser. In other words, no one can see this line --><br>
Copyright © 2000 Advanced Internet Technologies, Inc.<br>
</body>
</html>
|