Introduction

HTML previews on this site will use the stylesheet of this site.

If you're developing HTML from scratch, you may see different results because they will use your browser's default stylesheet.

HTML (Hypertext Markup Language) is a language that describes the structure of a web page.

HTML Elements

HTML is made up of elements.

An element typically consists of an opening tag (which may specify attributes and their values), content, and a closing tag. Some elements do not have content and a closing tag.

Anatomy of an HTML element
Anatomy of an HTML element

HTML Comments

Anything between <!-- and --> are comments. They don't do anything. Developers typically use them to put notes/separators.

<!--
  I am a comment.
  I can span multiple lines!
-->

Structure of HTML Documents

<!DOCTYPE html>
<html>
  <head>
    <!-- metadata goes here -->
  </head>

  <body>
    <!-- content goes here -->
  </body>
</html>
  • <!DOCTYPE html> signifies that the document is using HTML5 (the latest standard)

  • <html> is the root element it's always there encompassing everything

  • <head> is where you place metadata of the page (e.g. title, SEO metadata, etc.)

  • <body> is where you place the content of your page.

References