Recommended minimum HTML head
HTML, Metadata, Head · Jan 18, 2023
An essential part of an HTML document is the
<head> element, which contains metadata about the document. Some vital information, such as the document's title and character encoding are stored in the
More often than not, this sort of metadata can grow in complexity with time. However, there are a few important things that should never be omitted. Here's a list of the bare minimum you should include in your
<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Page Title</title> <meta name="description" content="Page description. No longer than 155 characters."> </head>
charsetmeta tag tells the browser what character encoding to use when rendering the document.
viewportmeta tag tells the browser how to render the page on mobile devices.
titleelement is used by search engines to display the page's title in search results.
descriptionmeta tag is used by search engines to display a short description of the page in search results.
Written by Angelos Chalaris
If you want to keep in touch, follow me on GitHub.