<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<link rel="stylesheet" href="./css/style.css">
<title>Document</title>
</head>
<body>
<div class="container mt-2 ">
<div class="main_div">
<div class="left_div">
<strong>Left Div</strong>
</div>
<div class="right_div">
<strong>Right Div</strong>
</div>
<div class="center_div">
<strong>Center</strong>
</div>
</div>
<h1>Hello</h1>
</div>
</body>
</html
Style.css
strong{
color:red;
}
.left_div,.right_div,.center_div{
text-align: center;
position: relative;
border: 1px dotted black;
padding: 20px;
}
.left_div{
float: left;
}
.right_div{
float:right;
}
.center_div{
margin: auto;
width: 100%;
float: initial;
}
.main_div::after{
content: '';
display: table;
clear:both;
}
Comments
Post a Comment
If you any doubt of any topic then you can comment me.