Titles

OK, hang in there, we're almost done learning HTML, and the hard parts are over. Now for an easier bit: Headers.

Headers are used as titles for web pages and sections within them. The commands are simple:

  • <h1> </h1>
  • <h2> </h2>
  • <h3> </h3>
  • <h4> </h4>
  • <h5> </h5>
  • <h6> </h6>

Each one displays bold text in a slightly different size, H1 being the largest, and H6 being the smallest:

You may use whatever header for whatever you wish, but obviously, <h1> is intended to act as the main title for a page; <h2> should then be the title for a subsection on that page; <h3> for a subsection of the subsection; and so on.

Each "hn" tag includes a paragraph break as part of its makeup, so you do not need to add a <p> or <br /> tags after them. Ending the "hn" tag will automatically create a paragraph break after the title.

Go ahead, in the Live Exercise below, try adding headers wherever you like. Note that you must end an "h" tag with the exact same ending tag--for example, the <h2> tag can only be ended with an </h2> tag, and not with any other header ending tag.


 



 



Video Review