Could we help you? Please click the banners. We are young and desperately need the money
When learning HTML, it is beneficial to know how to construct a basic scaffold. Every HTML site is built on top of this foundation.
To be able to following along with this guide, it is recommended that you know how elements (tags) work. If you do not know, you can read up on them in our guide on HTML elements.
This is a common variant of the HTML5 scaffold:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Page Title</title>
</head>
<body>
</body>
</html>
Let us analyse it.
The DOCTYPE should be declared at the beginning of every HTML site's code. The reason being that this is what signals to your browser (and the search engine) that the code is to be read and understood as an HTML document.
The <html> tag is the container for all HTML-related things. It is recommended to set the "lang" attribute to your site's intended language as this will make browsers and search engines happy.
The <head> tag is the container for all your site's metadata, such as the page title, the used character encoding (generally UTF-8), certain file includes (style sheets and scripts), and more. Elements of the <head> tag are not visible content of the site.
<meta> tags are used to define metadata. They assist browsers and search engines in understanding the site.
The <title> tag contains your site's title. Search engines require this.
The <body> tag is the container for all elements meant to be visible content (text, images, lists, buttons…). Also, at the bottom of the <body> tag is where you should include your JavaScript files.