Skip to content

Instantly share code, notes, and snippets.

@Tynael
Created March 21, 2023 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tynael/8ae9cf1e42556f387ed6615a2bb5809e to your computer and use it in GitHub Desktop.
Save Tynael/8ae9cf1e42556f387ed6615a2bb5809e to your computer and use it in GitHub Desktop.
Example of a web page rendered with and without DOCTYPE declaration
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>With DOCTYPE. NOT in Quirks mode.</title>
<style>
.styled {
color: red;
}
</style>
</head>
<body>
<h1>HTML with DOCTYPE</h1>
<p class="STYLED">I'm a styled paragraph. Or am I?!</p>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Without DOCTYPE. IN QUIRKS MODE!</title>
<style>
.styled {
color: red;
}
</style>
</head>
<body>
<h1>IN QUIRKS MODE! HTML without DOCTYPE. </h1>
<p class="STYLED">Wow...I'm a styled paragraph.</p>
</body>
</html>
@Tynael
Copy link
Author

Tynael commented Mar 21, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment