We have gone over elements like <div>
and others. These are common elements that you would come across in a normal HTML development case. There are others like <section>
, <article>
which are used like a div but in nuanced cases.
<section>
: The <section>
element defines a standalone part of a document, usually with a heading.
<article>
: The <article>
element represents a self-contained, reusable content piece, like a blog post, news article, or user comment.
You need <section>
and <article>
instead of just <div>
because they give meaning to the content. While <div>
is just a box with no specific meaning, <section>
and <article>
help organize the content in a way that is easier for both people and search engines to understand.
Like <section>
and <article>
, there are other elements designed for specific purposes in a webpage. These elements add meaning to the content and improve readability for both users and search engines.
-
<header>
: It is used to define a section's heading, typically containing a title, logo, or navigation links. -
<footer>
: It represents the bottom section of a page or section, often containing copyright information, links, or contact details. -
<aside>
: It is used for content that is related to the main content but not essential, such as sidebars, advertisements, or related links. -
<nav>
: It is used specifically for navigation menus or links that help users move around a website. -
<summary>
: Provides a summary or toggleable label for the<details>
element. -
<figure>
: Groups media content like images, illustrations, or code snippets. -
<figcaption>
: Provides a caption for the<figure>
element. -
<mark>
: Highlights text for emphasis or reference. -
<time>
: Represents a date/time, useful for events, timestamps, or scheduling.
Use the elements below to create a simple webpage that includes:
β A header with a site title and navigation menu.
β
A main sect on with a highlighted (<mark>
) announcement.
β
An article or content area with an image inside a <figure>
with a <figcaption>
. For the image you can use this, "https://picsum.photos/200"
β
A sidebar (<aside>
) with extra links or ads.
β
A footer with contact info and a timestamp using <time>
.
β
A collapsible FAQ section using <details>
and <summary>
.