Introduction
The <aside> element is used to show content related to the main part of the page but separate from it. It helps organize extra information clearly.
The <aside> element is used to show content related to the main part of the page but separate from it. It helps organize extra information clearly.
<aside> <!-- Related content here --> </aside>
<aside> element should contain content related but separate from the main content.<aside> <h3>Related Articles</h3> <ul> <li><a href="#">How to Grow Plants</a></li> <li><a href="#">Gardening Tips</a></li> </ul> </aside>
<aside> <p>Author: Jane Doe</p> <p>Contact: jane@example.com</p> </aside>
This example shows a main article with an <aside> on the side containing related article links. The aside has a light background and is separated visually.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Aside Element Example</title> <style> body { font-family: Arial, sans-serif; margin: 2rem; display: flex; gap: 2rem; } main { flex: 3; } aside { flex: 1; background-color: #f0f0f0; padding: 1rem; border-radius: 0.5rem; } a { color: #0066cc; text-decoration: none; } a:hover, a:focus { text-decoration: underline; outline: none; } </style> </head> <body> <main> <h1>Welcome to My Gardening Blog</h1> <p>Here you will find tips and tricks to help your plants grow healthy and strong.</p> </main> <aside aria-label="Related articles"> <h2>Related Articles</h2> <ul> <li><a href="#">How to Grow Tomatoes</a></li> <li><a href="#">Best Soil for Flowers</a></li> <li><a href="#">Watering Tips</a></li> </ul> </aside> </body> </html>
aria-label on <aside> to describe its purpose for screen readers.<aside> can be placed inside or outside <article> depending on the content relationship.<aside> element holds related but separate content.<aside> element in HTML?aside element with a note inside?<main>
<p>Main content here.</p>
<aside>
<p>Related links</p>
</aside>
</main><aside> <h2>Note</h2> <p>Remember to save your work.<p> </aside>
<aside> element. Which of the following is the best practice for accessibility and structure?Pass the test and this pattern moves unknown