Lesson 2B - HTML Tags

HTML is an acronym for HyperText Markup Language. It is the language translated by web browsers to produce the web pages you see.

Web browsers read HTML tags and respond to the enclosed commands. To make a tag, you place a command between < and > characters. Most commands have a "start" tag and an "end" tag. "End" tags begin with </. If a command has no "end" tag, it is coded like so: <br> (traditional syntax) or <br /> (XHTML compatible syntax).

You used eight tags to produce your first web page. Let's look closely at each one.

<html> and </html> tell the browser to interpret everything between these tags as written in HTML.
<head> and </head> give the browser information used to generate the web page, but not information to be shown on the web page.
<title> and </title> tell the browser the title of the page. This will appear in the title block at the top of the web page when it is displayed. It is also used by search engines and browsers to identify the page to the viewer. The title for this page is "Lesson 2B - HTML Tags". Note these tags appear between the <head> and </head> tags.
<body> and </body> give the browser information to be shown in the body of the web page.

These eight tags are mandatory for all HTML web pages, regardless of page content. Which ones are start tags, and which are end tags?

Suppose you want to write notes to yourself within the file, but you don't want them to appear on the web page? Similar to most programming languages, HTML provides for comments. The Comment tag has no end tag, whatever comment you want to write is inserted within the Comment tag itself:

<!-- write your comment here -->

Anything within the Comment tag will not be displayed. Try it.

Today's browsers are powerful, and are programmed to handle mistakes in the HTML code. You can make mistakes with tags, and those tags will be ignored. If new tags are invented and old browsers don't recognize them, they will simply be ignored also. This way, something will be displayed rather than have an error message appear when one tag is not understood. Most browsers will insert whichever of these eight mandatory tags are missing! This protects the programmer, but does nothing to encourage proper coding.


In this lesson, we learned about these tags:
<html> and </html>
<head> and </head>
<title> and </title>
<body> and </body>
<!-- -->


Lesson 2A Make a Web Page   < <  PREVIOUS   Table of Contents NEXT  > >   Lesson 2C White Space

Developed with HTML-Kit
Sandersongs Web Tutorials
Contact the Webmasterwith comments.
©2017, by Bill Sanders, all rights reserved.
This domain had 3,990 different visits in the last 30 days.
435,465 hits on this domain since 24 Nov 2006.
http://sandersongs.com/HTMLcourse/Lesson02B.php
This page was last modified on our server on 25 Sep 2013
and last refreshed on our server at 12:30 pm, MST
This file took 0.00992 seconds to process.