HTML5 <aside> Tag
Definition and Usage
The <aside>
tag is used to put additional content on a webpage that's separate from the main content.
Tip:The information within the <aside>
element is commonly positioned in a document's sidebar.
Note: The <aside>
tag doesn't look different on a web browser. But you can make it look special by using CSS for styling (like in the example below).
Global Attributes
The <aside>
tag in HTML can also use the Global Attributes.
Event Attributes
The <aside>
tag in HTML can also work with Event Attributes.
More Examples
Default CSS Settings
The <aside>
element in most web browsers will appear with its default settings as follows:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>Last summer, my family and I visited The Epcot center. The weather was nice, and we were amazed by the interesting things at Epcot. Having a good time with my family made my summer really fun.</p>
<aside>
<h4>Epcot Center</h4>
<p>Epcot is an enjoyable theme park situated in Walt Disney World Resort. It features exciting rides, various country-themed sections, impressive fireworks, and special events held throughout the year.</p>
</aside>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
aside {
width: 30%;
padding-left: 15px;
margin-left: 15px;
float: right;
font-style: italic;
background-color: lightgray;
}
</style>
<title>Page Title</title>
</head>
<body>
<h1>The aside element</h1>
<p>During this summer, my family and I went to The Epcot center. The weather was pleasant, and we were truly impressed by the wonders of Epcot. Spending quality time with my family made my summer truly enjoyable.</p>
<aside>
<p>Epcot is a fun theme park located at Walt Disney World Resort. It has cool rides, different country areas, awesome fireworks, and special events throughout the year.</p>
</aside>
<p>During this summer, my family and I went to The Epcot center. The weather was pleasant, and we were truly impressed by the wonders of Epcot. Spending quality time with my family made my summer truly enjoyable.</p>
<p>Epcot is a fun theme park located at Walt Disney World Resort. It has cool rides, different country areas, awesome fireworks, and special events throughout the year.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<style>
aside {
display: block;
}
</style>
<!-- Your existing code goes here -->
<h1>Welcome to My Page</h1>
<p>This is a dummy HTML content within the body.</p>
<aside>
<p>This is an aside section.</p>
</aside>
<footer>
<p>© 2023 My Website</p>
</footer>
</body>
</html>