HTML TUTORIALS-
HTML Div Element Tag β
Introduction-
HTML Div Element Tag - The <div> element in HTML is a generic container used to group together other HTML elements. It's short for "division" and is mostly used for styling (with CSS) or scripting (with JavaScript).
β Basic Example: -π
<div>
<h1>Hello, Welcome to our Website!</h1>
<p>www.learntosap.com</p>
</div>
www.learntosap.com
β Example 1: Center Divs Using text-align: center -π
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.container {
text-align: center;
}
.box {
display: inline-block;
width: 100px;
height: 100px;
background: lightblue;
margin: 10px;
}
</style>
</head>
<body>
<div class="container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
</div>
</body>
</html>