HTML 5 Notes For Professional

HTML 5 Notes For Professional – Chapter – 2 (Doctypes)

Doctypes – short for ‘document type’ – help browsers to understand the version of HTML the document is written in for better interpretability. Doctype declarations are not HTML tags and belong at the very top of a document. This topic explains the structure and declaration of various doctypes in HTML.

Adding the Doctype

The <!DOCTYPE> declaration should always be included at the top of the HTML document, before the tag.

Version ≥ 5

See HTML 5 Doctype for details on the HTML 5 Doctype.

<!DOCTYPE html>

HTML 5 Doctype

HTML5 is not based on SGML (Standard Generalized Markup Language), and therefore does not require a reference to a DTD (Document Type Definition).

HTML 5 Doctype declaration:

<!DOCTYPE html>

Case Insensitivity

Per the W3.org HTML 5 DOCTYPE Spec:

A DOCTYPE must consist of the following components, in this order:
1. A string that is an ASCII case-insensitive match for the string “<!DOCTYPE>”.

therefore the following DOCTYPEs are also valid:

<!doctype html>
<!dOCtyPe html>
<!DocTYpe html>

This SO article discusses the topic extensively: Uppercase or lowercase doctype?

Continue to Chapter 3: Headings

Recent Posts

Unlocking the Secrets of JSON.stringify(): More Than Meets the Eye

JSON (JavaScript Object Notation) is a lightweight data-interchange format widely used in web development. At…

2 months ago

How to Handle AJAX GET/POST Requests in WordPress

AJAX (Asynchronous JavaScript and XML) is a powerful technique used in modern web development that…

3 months ago

Page Speed Optimization: Post-Optimization Dos and Don’ts

Introduction After successfully optimizing your website for speed, it's essential to maintain and build upon…

3 months ago

Ultimate Guide to Securing WordPress Folders: Protect Your Site from Unauthorized Access

Securing your WordPress folders is crucial to safeguarding your website from unauthorized access and potential…

4 months ago

HTML CSS PHP File Upload With Circle Progress Bar

Creating a file upload feature with a circular progress bar involves multiple steps. You'll need…

4 months ago

Using WP Rocket with AWS CloudFront CDN

Integrating WP Rocket with AWS CloudFront CDN helps to optimize and deliver your website content…

4 months ago