HTML Styling Block Elements | HTML Goodies

HTML Styling Block Elements

Written By
Octavia Anghel
Octavia Anghel
Jul 2, 2018
5 minute read

The main purpose of this article is to present the various HTML5 elements that you can use in an HTML document structure for styling blocks. As you may notice, many web sites contain HTML code like:

 
 
 used to indicate navigation, header, and footer. HTML5 offers new semantic elements to define different parts of a web page:

The new HTML5 elements we will cover in this article are:

  • : contains the header content of a site.
  • : contains the footer content of a site.
  • : specifies independent, individual content, such as individual blog posts, videos, images or news items.
  • : The
     element is a structural HTML element used to group together related elements, like headers, footers, chapters, or any other sections of the document.

Typical Page Structure

As you probably noticed, websites generally have vastly different content, functionality, and look and feel, but they all have common elements, as you can see from the figure below:

  • Header (or masthead) at the top of the page, usually containing the company name and logo. This is the top of the page and in general, says what website is, some description, and who owns it.
  • Navigation menu used for navigating between pages or down the page. This is placed under the header, often put in a sidebar, or may be form part of the header.
  • One or more sidebars (placed in right or left of the main content of the page), containing some links, in general, that are related to the current page main content, related to the other pages from the website or from the outside of the website. The sidebar/sidebars may differ from one page to the other, (for example: “your basket” information on an e-commerce site, or some filters during on a shopping item, like colors, sizes, price filter, material etc).
  • A footer that is placed at the bottom of the site and contains subsidiary information such as copyright information and contact details.

Let’s have a look at some of the HTML5 elements in more detail.

The

 tag defines sections in a document, like headers, footers, chapters, or any other sections of the document.

<section>
  <h2>Head</h2>
  <p>Some text</p>
  <img src="figure.jpg" alt="figure">
</section>

The

 tag is related to the
 tag, but the
 specifies independent, individual content , such as individual blog posts, videos, images or news items, comment, while
 tag is used for grouping distinct sections of content or functionality. An article should make sense on its own and it should be possible to distribute it independently from the rest of the site.

<article>
  <h2>Head</h2>
  <p>Some text</p>
  <img src="figure.jpg" alt="figure">
</article>

As we said earlier, the purpose of the

 and
 elements is to wrap the header and footer content. In general, the
 element contains a logo image, and the
 element contains some copyright notice, but is not mandatory to be that way, you can add more elaborate content if you like. Also note that you can have more than one header and footer on each page, you can also have a
 and
 element nested inside each
, in which case they would just apply to that particular article. Adding to our above example:

<article>
  <header>
  </header>

  <section id="intro">
  </section>
  
  <section id="main content">
  </section>
  
  <section id="summary">
  </section>
  
  <footer>
  </footer>
</article>

The

HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.