HTML, Part 4 : Tags |
by Evan Goer | |
April 26, 2003 | |
This tutorial explores the ins and outs of HTML tags. Tag Components Tags have three main components:
<tagname attribute1="value1" attribute2="value2"...> Some tags do not require a closing tag or attributes to work properly:
Background Color (source) <body style="background-color: yellow"> We'll discuss attributes in the next section. For now, let's focus on simple tags. UPPER CASE, lower case Case is irrelevant for tags. Some people prefer all upper case, so that when they look at their HTML source, it's easier to differentiate tags and text. I personally prefer all lower case, because I find it easier to type the tags that way. Either way, it's just a particular style choice. , , and even are all the same tag. Misspellings and Misunderstandings Vastly simplified, a browser processes an HTML page something like this:
When a browser ignores a tag, that means one of two things:
An example of #2 is the tag. This tag works in Mozilla and in nearly all versions of Netscape Navigator. Internet Explorer and many other browsers do not support it. Blinking Text (source) Warning: For external use only. Warning: The Blink Tag Most people find the tag distracting and irritating. In fact, I am aware of only one example of a good use of the blink tag on the entire World Wide Web. Well, maybe two. If you are using any version of Netscape Navigator (other than version 6, I think), the text in the Results box below should be blinking. If you are using Internet Explorer, the text will not be blinking. This is actually a very common situation when using HTML: one browser will support a particular aspect of HTML, while another doesn't... or worse, supports it incorrectly. Fortunately in the case of the tag, this is no great loss. Blink Tag (Results) Warning: For external use only. Avoid contact with eyes. Have a question? Need help? Get free, friendly person-to-person help with your computer questions or spyware questions in our help forums! |