Table of Contents
INTRODUCTION
The HTML <aside> element is used to represent a section of a document containing content that is loosely connected to the main content.
It is often used for sidebars, advertisements, related links, or additional information that complements the main topic.
Display: The <aside> element does not have any original styling of its own and does not appear as sidebar by default. You can use CSS to make it appear as sidebar.
Example:
<main>
<h1>Main Content</h1>
<p>A car, also known as an automobile, is a wheeled motor vehicle primarily designed for road use. Most definitions describe cars as having four wheels, seating between one and eight passengers, and being mainly intended for transporting people rather than cargo. There are approximately one billion cars in operation globally.</p>
</main>
<aside>
<h2>Related Articles</h2>
<p>The first steam-powered road vehicle was built in 1769 by French inventor Nicolas-Joseph Cugnot.
</p>
</aside>
Main Content
A car, also known as an automobile, is a wheeled motor vehicle primarily designed for road use. Most definitions describe cars as having four wheels, seating between one and eight passengers, and being mainly intended for transporting people rather than cargo. There are approximately one billion cars in operation globally.
aside {
width: 40%;
padding-left: 0.5rem;
margin-left: 0.5rem;
float: right;
}
Main Content
A car, also known as an automobile, is a wheeled motor vehicle primarily designed for road use. Most definitions describe cars as having four wheels, seating between one and eight passengers, and being mainly intended for transporting people rather than cargo. There are approximately one billion cars in operation globally.
Cars have controls for driving, parking, passenger comfort, and a variety of lamps. Over the decades, additional features and controls have been added to vehicles, making them progressively more complex. These include rear-reversing cameras, air conditioning, navigation systems, and in-car entertainment.
Tag Omission
The HTML <aside> element must have both start tag and end tag.
ATTRIBUTES
The <aside> element only has global attributes.
Frequently Asked Questions(FAQ)
What is the purpose of the <aside> element in HTML?
Can the <aside> tag be placed within an <article>?
what is the difference between the <aside> and <section> element?
Should the <aside> element be placed inside or outside the <main> element?
Is it appropriate to use the <aside> element for footnotes or sidenotes within a paragraph?
How can I style the <aside> element to appear as a sidebar?
aside {
width: 30%;
padding-left: 15px;
margin-left: 15px;
float: right;
font-style: italic;
background-color: lightgray;
}