The latest version of HTML is HTML5.
These are terms used to classify elements based on how they are displayed. For example, heading and paragraph elements take up the full width and appear on their own line—these are called block elements. In contrast, anchor and image tags do not break the flow and appear within a line—these are called inline elements.
This is a paragraph (block)
This is a link (inline)Both <div>
and <span>
are container elements.
A div
is a block-level container used to group content and apply styles to them as a unit.
A span
is an inline container with similar use to div
, but it does not start on a new line.
Creates a horizontal line and does not have a closing tag.
Breaks the line and moves the content to the next line.
Superscript: 2nd
Subscript: H2O
Entities are used to display reserved or special characters in HTML. They begin with &
and end with ;
.
Example: ©
Semantic elements describe the meaning or purpose of the content, making the code more readable and accessible. The following tags are like <div>
but have specific roles:
Defines the main content of the document.
Used for navigation menus or links.
Groups related content; preferred over generic <div>
in many cases.
Used for self-contained content like blog posts or news articles.
Contains content that is tangentially related to the main content (e.g., sidebars).
Represents the introductory content or navigation links.
Defines the footer of a section or the entire page.
Used to represent dates and times.
figcaption
is used inside figure
to provide a caption for an image or diagram.