HTML Div tag
Div tag in HTML:
The "Div" tag in HTML is a versatile container element used to group and style other elements together.
It helps structure and organize content on a webpage and is often used for applying CSS styles or creating layout structures.
Example
The "Div" tag is like a virtual field.
It does not have any particular which means on its very own but is used to institution and fashion different elements, growing sections of content on a website.
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 LearnFasta.com</title>
<style>
body {
font-family: 'Arial', sans-serif;
text-align: center;
margin-top: 50px;
font-size: 18px;
}
.section {
background-color: #f1c40f; /* Yellow background */
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Box shadow for a subtle lift */
}
h1 {
color: #2c3e50; /* Dark gray color for heading */
}
p {
margin-top: 10px;
color: #34495e; /* Dark blue-gray color for text */
}
</style>
</head>
<body>
<div class="section">
<h1>Welcome to Our LearnFasta.com</h1>
<p>Your very welcome. Explore and learn with us!</p>
<p>Join our community of learners and dive into a world of knowledge.</p>
</div>
</body>
</html>
Try it Yourself »