Dragifon

HTML

HTML Elements

DOCTYPE (<!DOCTYPE [attribute]>) -

must be defined at the beginning of all html documents. "html" attribute is used to define HTML5 webpages.

html (<html> </html>) -

defines the beginning of the html code. Global Attributes and "manifest" attribute. It is recommended that the "lang" Global Attribute be assigned here ("lang="en"" for English). The "head" and "body" elements are required contents of the "html" element, and they must be placed in that order ("<head> </head> <body> </body>").

head (<head> </head>) - the first element in an "html" element. Contains metadata (settings) of the webpage. Global Attributes. The "title" element must be put within the "head" element ("<head> <title> </title> </head>") and there must only be one (1) "title" element.

title (<title> </title>) -
text inbetween these tags will be the name of the webpage. This usually shows up in the tab at the top of the browser. Global Attributes. A webpage should only have one (1) set of "title" tags. The "title" contents should be short, but specific of the page's contents ("About" should be avoided because every site has an about page.Use "About [website name]" instead).

body (<body> </body>) -
the second, and last element of the "html" element. Contains the main content of the webpage. Global Attributes and several others.

article (<article> </article>) - the independent content of the page. Global Attributes. The contents for which a user visits the webpage (a blog post, forum post, comment, wiki entry, newspaper article, flash game, etc.).

section (<section> </section>) - subgroupings of the contents of a webpage. Global Attributes. Chunks of the content for which a user visits the page (a game thumbnail in a list of game thumbnails, subsection of a wiki entry, a part of a page that could be linked to from a table of contents, a chapter in a book where the book represents an "article", etc.).

nav (<nav> </nav>) - contains links for getting around the website (different pages or parts of pages). Global Attributes. Doesn't have to be used for every link. It is intended to be used for sections of important links (links to other pages of the website, or a table of contents at the top of a long webpage) for navigating the website. Using multiple "nav" elements is fine. Typically the links are placed inside a list element, but that's not mandatory.

aside (<aside> </aside>) -

h1, h2, h3, h4, h5, and h6 (<h[#]> </h[#]>) - used for creating headings for sections. Global Attributes. Can be used in the "hgroup" element. These elements are ranked where "h1" is the highest, "h6" is the lowest, and any two of the same number ("h3" and "h3") have the same rank. This means they can be nested to denote subsections.

hgroup (<hgroup> </hgroup>) - used to treat multiple "h[#]" elements as a single heading so that titles and subtitles will be grouped together and treated as one section. Global Attributes. Must only contain "h[#]" elements.

Last Updated: September 20, 2013 Published: September 20, 2013