HTML layouts organize content for better presentation and usability. With CSS, you can create layouts that enhance the structure and flow of the content. Below are some popular layout techniques and examples of each.
Layouts help display information in a structured, easy-to-read format. They also help create responsive designs that adjust well on various screen sizes, from desktops to mobile devices.
This layout places all content in a single vertical column, useful for mobile or simple web pages.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome To My Layouts Page</title>
</head>
<body>
<div>
<h2>Single Column</h2>
<p>This is a single-column layout example. All content is stacked vertically.</p>
</div>
</body>
</html>
Single Column
This is a single-column layout example. All content is stacked vertically.
In the absence of CSS, tables can be used to simulate a two-column layout. Each cell represents a column.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome To My Layouts Page</title>
</head>
<body>
<table border="1" cellpadding="10">
<tr>
<td>
<h3>Sidebar</h3>
<p>This is the sidebar area.</p>
</td>
<td>
<h3>Main Content</h3>
<p>This is the main content area.</p>
</td>
</tr>
</table>
</body>
</html>
Sidebar
This is the sidebar area.
Main Content
This is the main content area.
A multi-column layout can be created by nesting tables within cells. This approach divides content into multiple sections.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome To My Ifarme Page</title>
</head>
<body>
<table border="1" cellpadding="10">
<tr>
<td>
<h3>Column 1</h3>
<p>Content for the first column.</p>
</td>
<td>
<h3>Column 2</h3>
<p>Content for the second column.</p>
</td>
<td>
<h3>Column 3</h3>
<p>Content for the third column.</p>
</td>
</tr>
</table>
</body>
</html>
Column 1
Content for the first column.
Column 2
Content for the second column.
Column 3
Content for the third column.
This layout includes a header, content section, and footer arranged vertically.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome To My Ifarme Page</title>
</head>
<body>
<div>
<h2>Header</h2>
<p>This is the header section, usually containing a logo and navigation links.</p>
</div>
<div>
<h2>Main Content</h2>
<p>This is the main content area where the bulk of the content goes.</p>
</div>
<div>
<h2>Footer</h2>
<p>This is the footer section, typically containing copyright or contact information.</p>
</div>
</body>
</html>
Header
This is the header section, usually containing a logo and navigation links.
Main Content
This is the main content area where the bulk of the content goes.
Footer
This is the footer section, typically containing copyright or contact information.
HTML layouts provide basic structural elements to arrange content meaningfully. This layout foundation helps create a coherent and navigable webpage.