Headers
Remember: HTML should be used to
describe the organization of a page, not how it looks.
You may have noticed that HTML tags tell you more about what something means
than how something looks. This is actually a deliberate decision and it is
what HTML was designed for: describing the structure of a page
and how it is organized instead of how it should look. A good example of this
are header tags.
Try It: Add some header tags to your
file.
Header tags
This is an
This is an
This is an
A header tag, such as Header tags
This is an <h1>
This is an <h3>
This is an <h6>
<h1>
, tells the browser you want it
to display an important heading on your page. Most browsers display headers
as bold, in a larger font size, and with a blank line above and below it. Header
tags are container tags, so you put the text of your header between the
<h1>
and the </h1>
.
The "1"
in <h1>
means this heading is as important as can be; it's
at the highest level. You can also have <h2>
which is a
little less important,
<h3>
, which is less than that, and so on to <h6>
.
Most browsers make each of these a little smaller than the one before.
Try It: View the source of this page
to see the
The line of text that says "Headers" at the top of this
page is inside a <h1>
tag.
<h1>
. You can actually see this
is the case by viewing the source of this page!
End of Topic