I want to start creating websites again, but I\'ve been out of the HTML scene for a while now. I was just wondering if this is a good skeleton for a website. And if not, what sh
Example
Example
An HTML5 skeleton could look like this:
CC
(Note that this is not the most minimal HTML5 document, so many parts are optional.)
If you are using a different encoding than UTF-8, change the value of the meta-charset accordingly.
If you are using a different content language than English, change the value of the lang attribute accordingly.
If you want to explicitly specify the text directionality, use the dir attribute on the html
element, e.g.:
link
/meta
elements to add to the head
Linking to a stylesheet (text/css
is assumed by default):
Linking to a favicon:
Specifying the canonical URL of the document:
Providing a description of the page’s content:
body
As each page is different, this can‘t be answered generally, so it might be best to leave the body
empty.
However, most pages probably are part of a website, and most websites probably have a site-wide header (→ header
) with site name (→ h1
), footer (→ footer
) and navigation menu (→ nav
). These should belong to the body
sectioning root (i.e., have no other sectioning content element as parent). The nav
may or may not be part of the header
.
The main content (→ main
) may or may not consist of a sectioning element (usually article
or section
, or multiple of them).
Example