#capture #organize
<!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>HTML 5 Boilerplate</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script src="index.js"></script>
</body>
</html>
https://www.freecodecamp.org/news/basic-html5-template-boilerplate-code-example/
What is a doctype in HTML?
The first line in your HTML code should be the doctype declaration. A doctype tells the browser what version of HTML the page is written in.
<!DOCTYPE html>
If you forget to include this line of code in your file, then some of the HTML 5 tags like <article>
, < footer >
, and <header>
may not be supported by the browser.
What is the HTML root element?
The <html>
tag is the top level element of the HTML file. You will nest the <head>
and <body>
tags inside of it.
<!DOCTYPE html>
<html lang="en">
<head></head>
<body></body>
</html>
The lang
attribute inside the opening <html>
tag sets the language for the page. It is also good to include it for accessibility reasons, because screen readers will know how to properly pronounce the text.
What are head tags in HTML?
The <head>
tags contain information that is processed by machines. Inside the <head>
tags, you will nest metadata which is data that describes the document to the machine.
<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>HTML 5 Boilerplate</title>
<link rel="stylesheet" href="style.css">
</head>
What is UTF-8 character encoding?
UTF-8 is the standard character encoding you should use in your web pages. This will usually be the first <meta>
tag shown in the <head>
element.
<meta charset="UTF-8">