|
Basic HTML TagsHTML works with what are called tags. These tags tell the browser where to put text and images on the screen as well as define some properties for these elements. Most tags will come in pairs of "opening" and "closing" tags, which surround the elements that are going to be affected by them. These tags pairs will always be in the form: Opening tags: <tag_name> Closing tags: </tag_name> The <HTML> tag is the first tag that will appear in your code. This in essence tells the browser that an HTML document is coming. At the very end of the document will be its closing tag </HTML>. These pair of tags define what the browser will read and transfer to the screen. Any text outside these tags will be ignored.
The next tag is the <HEAD> tag. As you may have guessed, this tag will enclose all of your header
information. There is quite a bit of information which can be defined in the header, but for now we will only discuss
one;
the <TITLE> tag. The <TITLE> tag puts the title of your web page at the top of your Netscape or Internet
Explorer
window. The header ends with a </HEAD> tag. Putting these tags together, we can construct a very simple (but functional) web page:
Which would look like this. Granted, it isn't all that exciting, but all web pages (no
matter how complex) work in the same way as this one.
Style Tags Example:
Another style tag is the <EM> tag, which gives emphasized text. On most systems this will show on the screen as italics. <EM> works in exactly the same way as <B>. Example:
The final types of style tags are the "heading" tags. These tags display text in six different font sizes, which are usually used to put headings on sections of your text, such as I have used for "Basic HTML Tags" above. They come in the form <Hn>, with n being a number between one and six. One will give you the largest font and six will give you the smallest. Example:
When browsers look at text in an HTML document, they don't read any line breaks or place any blank lines that you may have put into your document. This is because "white space" is ignored. This is any blank spaces or carriage returns that you might have put into the document. The browser rearranges all your words side by side, and wraps them to the size of the window.
Example:
In order to get around these constrictions, several more tags exist which allow for line breaks and paragraph breaks. The former is the <BR> tag, which will end the current line of text and go to the beginning of the next. The latter is the <P> tag, which goes to the next line on the screen and starts a new paragraph. Both of these tags do not require a closing tag. Example:
The final tag that will be covered in this section is the <HR> tag, which stands for horizontal rule. This tag will put a horizontal bar across your window, which is used to separate different parts of your text, or add emphasis to the next part. This tag also does not require a closing tag. Example:
Putting it all Together Now that we have a larger arsenal of tags, it is possible to create a complete web page that is much more interesting than our last one:
|