The first thing you need to learn about HTML is the use of elements, which is the core of HTML. An element creates the structure of an HTML document and instructs the browser how you want your webpage to be
displayed. Most elements consists of a start tag, content, and an end tag. However, some elements only have a start tag and no content,
such as with the line break element, <br />. Opening tags are surrounded by
less than and greater than symbols. The end tags also use these symbols and include a forward slash, such as in this example: <tag>, </tag>. HTML is not as strict as XHTML as we discussed in previous
articles. However, it's a good idea to always use a closing tag if the element allows for it and also make sure that your tags are in lowercase. This takes care of making your pages two-thirds compliant
with XHTML. Since modern browsers support various versions of HTML, not following these rules will most likely result in the same display. However, to ensure that your pages are rendered in a consisitent format
across the modern browsers, code your pages following the stricter standards.
Examples
Element | Description | Results |
<a> | Used to create a hyperlink | http://www.itgeared.com |
<h1> | HTML Heading 1 | Heading 1 |
<h2> | HTML Heading 2 | Heading 2 |
<i> | Italics | Italics |
<p> | Defines a paragraph | This is a paragraph |
Where do I place these tags?
Most of your tags will be placed in the body of an HTML document. Some tags are placed in certain areas of a page that do not contain content displayed on the screen. We will learn about the basic structure of a
webpage in the upcoming articles. For now, you can simply open a text editor (such as notepad) and add some tags with content and save the file as .htm (not as a ".htm.txt"). If you saved the file correctly, you should
see the icon for the file change from that of a text document to an HTML document. Once you have saved the file, you can view the webpage by right clicking the file and selecting a browsing application to open it, such
as Internet Explorer. The page should render as a webserver is not required to view an HTML document stored on your computer.
Did you find the page informational and useful? Share it using one of your favorite social sites.
Recommended Books & Training Resources