HTML Elements
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element
Important Sections
The following is a prioritized list of HTML elements to learn. They are grouped into rough categories based on how they are used with the most necessary or frequently used categories listed first. Within each category is an ordered list containing elements you should know
Root Elements
These elements are necessary and there should be one, and only one, of each of these in your file. All other elements should be nested within them, so we call them top-level or root elements.
- html
- head
- body
Document Metadata
These elements contain information about your file. The information isn't rendered as part of your web page, but it's used in many places. For example, the page title is shown in the browser tab or in the bookmark bar. Metadata is used by other programs, like search engines or social media sites.
- title
- meta
- link
Other: style, base
Content Sectioning
These elements allow you to organize your content. If an entire newspaper was one long paragraph, it wouldn't be readable. Separating related elements into sections helps your user find what they're looking for.
- h1 - h6
- nav
- main
- article
- header
- footer
- aside
- section
Other: address, hgroup
Block Text Content
These elements break sections into even smaller blocks describing the purpose of that text content.
- p
- ol and ul
- li
- hr
- div
Other: blockquote, figure, figcaption, dl, dt, dd, pre
Inline Text Content
These elements describe the purpose of a word or phrase within a larger block of text.
- a
- strong and em
- time
- code
- br
- span
Other: abbr, sub, sup, q, cite, data, mark, s, small, var
Note: there are more in this category, but you probably shouldn't be using them.
Media Content
These elements handle content that isn't text.
- img
- audio
- video
Other: track, area, map
Form Content
These elements are for the user to submit data to a web application to save or process.
- form
- label
- input
- button
- select and option
- textarea
Other: fieldset, legend, datalist, meter, optgroup, output, progress
Table Content
These elements are for displaying tabular data. If the content would fit in a spreadsheet, it should go in a table.
- table
- tr
- td and th
- thead, tbody, tfoot
Other: colgroup, col
Scripting
These elements support JavaScript to create dynamic web pages, from simple animations to complex web applications.
- script
Other: canvas, noscript
Embedded Content
These elements are for embedding more complicated content than the media elements. For example, an iframe allows you to place another web page inside your web page while a picture element allows you to define alternative images for an img element to be used with different displays.
- iframe
- picture
- source
Other: object, param, embed
Other Sections
There are two other sections (Demarcated Edits and Web Components) that you don't need to know right now, but the last section for Obsolete and Deprecated Elements is very important to look over. You will undoubtedly run into these elements in articles or tutorials that were written years ago. Do your best to avoid them. Even though browsers might be able to handle them, they are getting phased out and shouldn't be added to new projects. If you see them in an old project, figure out how to update them to modern elements.