Better Programming

Advice for programmers.

Member-only story

CSS Basics

Understanding the Tags in HTML Boilerplate

<!DOCTYPE>, <html>, <head>, <meta>, <title>, <body>, <link>, and <script>

aliceyt
5 min readNov 6, 2019

--

Photo by Annie Spratt on Unsplash

While some HTML tags are self-explanatory, others are not.

Instead of adding them blindly into your HTML file, how about finding out what they are?

HTML Boilerplate

Let’s go through an HTML boilerplate line by line.

To generate it, we use the shorthand command by typing [ ! ] + [ tab ] on an HTML file opened in a code editor with Emmet.

HTML boilerplate

Line 1

The first thing to do when creating an HTML document is to include a document type definition declaration.

<!DOCTYPE html>

This is used by:

  • Browsers to determine whether to render the webpage in standards mode (which is according to CSS specifications) or quirks mode (which is more backwars compatible with old practices and old browsers)
  • Markup validators to determine which HTML rules to use when checking through the HTML syntax

--

--

aliceyt
aliceyt

Written by aliceyt

Read to write and 📝 to 📖 | Articles organised by categories on https://github.com/tiffam/medium_articles

No responses yet