HTML Main tag
Main tag in HTML:
The "main" tag in HTML is used to mark the main content area in a web page.
It's a semantic element that facilitates become aware of the primary content that ought to be the point of interest of the web page.
Example
The "main" tag is sort of a virtual highlight.
It's used to indicate the main content area of a webpage, which normally consists of the core data or primary problem of the page.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to Our Website</title>
<style>
body {
font-family: 'Arial', sans-serif;
text-align: center;
margin-top: 50px;
font-size: 18px;
}
header {
background-color: #333;
color: white;
padding: 10px;
}
h1 {
margin: 0;
font-size: 24px;
}
nav {
margin-top: 10px;
}
a {
color: white;
text-decoration: none;
margin: 0 10px;
font-size: 16px;
}
main {
margin-top: 20px;
}
h2 {
color: #3498db; /* Blue color for heading */
}
p {
margin-top: 10px;
color: #34495e; /* Dark blue-gray color for text */
}
</style>
</head>
<body>
<header>
<h1>Welcome to Our Website</h1>
<nav>
<a href="#">Home</a>
<a href="#">About Us</a>
<a href="#">Services</a>
<a href="#">Contact</a>
</nav>
</header>
<main>
<h2>About Us</h2>
<p>We are a dedicated team...</p>
<h2>Our Services</h2>
<p>Our services include...</p>
</main>
</body>
</html>
Try it Yourself »