-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics
A layout is how content is structured and arranged on a webpage.
In modern HTML5, layout is created using semantic elements, divisions, and styled using CSS.
Tag | Purpose |
---|---|
<header> |
Defines header of a section/page |
<nav> |
Defines navigation links |
<main> |
Main content of the document |
<section> |
Section of content |
<article> |
Self-contained content |
<aside> |
Side content (ads, links, etc.) |
<footer> |
Footer of a section/page |
<body>
<header>My Website Header</header>
<nav>Home | About | Contact</nav>
<main>
<section>
<article>
<h2>Blog Post Title</h2>
<p>Content goes here...</p>
</article>
</section>
<aside>Related links or ads</aside>
</main>
<footer>Copyright © 2025</footer>
</body>
<div>
and CSSOlder or custom layouts often use <div>
elements combined with CSS.
<div class="container">
<div class="header">Header</div>
<div class="menu">Menu</div>
<div class="content">Main Content</div>
<div class="footer">Footer</div>
</div>
.container {
width: 100%;
}
.header, .footer {
background-color: #f1f1f1;
padding: 10px;
}
.menu {
background-color: #ccc;
float: left;
width: 20%;
height: 300px;
}
.content {
float: left;
width: 80%;
height: 300px;
background-color: #e2e2e2;
}
<div class="flex-container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
</div>
.flex-container {
display: flex;
}
.box {
flex: 1;
padding: 20px;
border: 1px solid #000;
}
Q1. Create a layout with <header>
, <nav>
, <main>
, and <footer>
.
Q2. Add two <section>
tags inside <main>
, each with its own content.
Q3. Use <aside>
to add a sidebar next to the main content.
Q4. Create a layout using <div>
with four sections: header, menu, content, footer.
Q5. Use CSS to float menu on the left and content on the right.
Q6. Create a 3-column responsive layout using Flexbox.
Q7. Add a full-width header and footer with different background colors.
Q8. Use <article>
inside <section>
to structure blog posts.
Q9. Create a layout where the sidebar collapses on smaller screens.
Q10. Apply different heights to each layout section using CSS.
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics