📖 Scenario: You are creating a simple webpage for a blog article. You want to add a sidebar that contains extra information related to the article but separate from the main content.
🎯 Goal: Build a basic HTML page with a main article section and an <aside> element that holds related information. This will help you understand how to use the <aside> element semantically.
📋 What You'll Learn
Create a basic HTML5 page structure with <html>, <head>, and <body> tags
Add a <main> element containing a heading and a paragraph for the article
Add an <aside> element with a heading and a short paragraph for related info
Use semantic HTML elements properly
Include lang attribute in <html> and charset and viewport meta tags in <head>
💡 Why This Matters
🌍 Real World
Many websites use the <code><aside></code> element to show sidebars, related links, advertisements, or extra info that complements the main content.
💼 Career
Understanding semantic HTML elements like <code><aside></code> is essential for building accessible, well-structured web pages that are easy to maintain and improve.
Progress0 / 4 steps
1
Create the basic HTML5 page structure
Create a basic HTML5 page with <html lang="en">, <head> containing <meta charset="UTF-8"> and <meta name="viewport" content="width=device-width, initial-scale=1.0">, and an empty <body>.
HTML
Hint
Start by writing the basic HTML5 page structure with the required lang and meta tags.
2
Add the main article content
Inside the <body>, add a <main> element. Inside <main>, add a heading <h1> with the text Blog Article and a paragraph <p> with the text This is the main content of the blog article..
HTML
Hint
Use the <main> tag to wrap the main content. Add a heading and a paragraph inside it.
3
Add an <aside> element with related information
After the <main> element, add an <aside> element. Inside <aside>, add a heading <h2> with the text Related Info and a paragraph <p> with the text This sidebar contains extra information related to the article..
HTML
Hint
The <aside> element is used for content related to the main content but separate from it. Add a heading and paragraph inside it.
4
Complete the HTML page with semantic structure
Ensure the HTML page includes the <html lang="en"> attribute, the <head> with charset and viewport meta tags, a <main> element with heading and paragraph, and an <aside> element with heading and paragraph. The page should be well-structured and ready to display in a browser.
HTML
Hint
Make sure all tags are properly closed and the page is complete with semantic elements.
Practice
(1/5)
1. What is the main purpose of the <aside> element in HTML?
easy
A. To hold content related but separate from the main content
B. To create the main heading of the page
C. To define the footer section of a webpage
D. To embed images in the page
Solution
Step 1: Understand the role of <aside>
The <aside> element is designed to hold content that is related but separate from the main content, like sidebars or notes.
Step 2: Compare with other elements
Elements like <header>, <footer>, and <img> serve different purposes, so they are not correct here.
Final Answer:
To hold content related but separate from the main content -> Option A
Quick Check:
<aside> = related but separate content [OK]
Hint: Think sidebar or note content separate from main [OK]
Common Mistakes:
Confusing <aside> with <footer>
Using <aside> for main content
Thinking <aside> is for images only
2. Which of the following is the correct syntax to add an aside element with a note inside?
easy
A. <aside>Note: This is important.<aside>
B.
C. Note: This is important.
D. <aside>Note: This is important.
Solution
Step 1: Check proper opening and closing tags
The <aside> element must have both opening <aside> and closing </aside> tags around the content.
Step 2: Identify correct option
<aside>Note: This is important.</aside> correctly wraps the note inside <aside> and </aside> tags. Others miss closing tags or place content outside.
Final Answer:
<aside>Note: This is important.</aside> -> Option B
Quick Check:
Proper tag syntax = <aside>Note: This is important.</aside> [OK]
Hint: Always close your tags properly [OK]
Common Mistakes:
Forgetting the closing </aside> tag
Placing content outside the <aside> tags
Using incorrect tag names
3. What will the following HTML code display in a browser?
A. The entire content will be shown as one paragraph
B. Only 'Main content here.' will show; aside content is hidden
C. An error message because aside cannot be inside main
D. Main content with a separate section showing 'Related links' as a sidebar or note
Solution
Step 1: Understand <main> and <aside> roles
The <main> holds the main content, and <aside> holds related but separate content, often shown as a sidebar or note.
Step 2: Predict rendering
The browser will display the main paragraph and separately show the aside paragraph, usually visually distinct.
Final Answer:
Main content with a separate section showing 'Related links' as a sidebar or note -> Option D
Quick Check:
<aside> shows related content separately [OK]
Hint: Aside shows related content separately from main [OK]
Common Mistakes:
Thinking aside content is hidden
Believing aside cannot be inside main
Assuming all text merges into one paragraph
4. Identify the error in this HTML snippet:
<aside>
<h2>Note</h2>
<p>Remember to save your work.<p>
</aside>
medium
A. Aside tag is not closed properly
B. Aside element cannot contain headings
C. Missing closing tag for the paragraph inside aside
D. Using <h2> inside aside is invalid
Solution
Step 1: Check paragraph tags
The paragraph starts with <p> but is missing the closing </p> tag.
Step 2: Validate aside content rules
Aside can contain headings and paragraphs, so those are valid.
Final Answer:
Missing closing tag for the paragraph inside aside -> Option C
Quick Check:
Always close <p> tags properly [OK]
Hint: Check all tags have matching closing tags [OK]
Common Mistakes:
Ignoring missing closing tags
Thinking headings are not allowed in aside
Assuming aside tag is not closed
5. You want to add a sidebar with related articles on your webpage using the <aside> element. Which of the following is the best practice for accessibility and structure?
hard
A. Place <aside> inside <main>, use a heading inside <aside> to label it, and ensure keyboard users can navigate it.
B. Place <aside> outside <body> for better separation and skip headings inside it.
C. Use multiple <aside> elements without headings to keep it simple.
D. Put <aside> inside <footer> and avoid any labels or roles.
Solution
Step 1: Understand semantic placement
The <aside> element is best placed inside <main> if it relates to that content, making structure clear.
Step 2: Accessibility best practices
Adding a heading inside <aside> helps screen readers understand its purpose. Keyboard navigation must be possible.
Step 3: Evaluate other options
Placing <aside> outside <body> or inside <footer> without labels harms semantics and accessibility. Multiple asides without headings confuse users.
Final Answer:
Place <aside> inside <main>, use a heading inside <aside> to label it, and ensure keyboard users can navigate it. -> Option A
Quick Check:
Semantic structure + accessibility = Place <aside> inside <main>, use a heading inside <aside> to label it, and ensure keyboard users can navigate it. [OK]
Hint: Use headings inside aside and place it semantically [OK]
Common Mistakes:
Placing aside outside body
Skipping headings inside aside
Ignoring keyboard accessibility
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.