Block Elements
Headings
Heading elements are h1 though h6, and display in decreasingly smaller sizes. In current practice there should only ever be one <h1>
element per page, and it should typical mirror, or very closely match, the page’s <title>
element.
<h1 id="world_wide_web">The World Wide Web</h1>
<h2 id="learning_html">Learning HTML</h2>
<h3 id="announcements">Announcements</h3>
For reasons that will become clear when we look at Hyper Links it’s a good practice to add a unique id
attribute wherever you use a heading element, though it’s not strictly necessary.
Paragraphs
Paragraphs (<p>
) delimit paragraphs.
<p>HTML, all by itself, can be viewed on any browser. HTML, all by itself, can be viewed on any platform. HTML, all by itself, can be viewed on any device. HTML, all by itself, is 99% accessible.</p>
Divisions
Divisions (<div>
) are used where no other block level element makes sense. It’s a block level element with no other styles. It’s most often used as a structure that CSS is applied to. It’s similar in a sense to the <section> element.
<div>
<p>HTML, all by itself, can be viewed on any browser. HTML, all by itself, can be viewed on any platform. HTML, all by itself, can be viewed on any device. HTML, all by itself, is 99% accessible.</p>
</div>