Hi dear welcome to "CodePrime" Blog . In this post we are going to learn how to use css float property. First Creat A index.html file Copy This HTML CODE and pest it one your code editor. 2ndly creat style.css file Then Copy The CSS CODE and pest it then open the index.html file with your browser.
HTML CODE
<!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">
<title>css float property by codeprime-bangladesh</title>
</head>
<body>
<div class="box"></div>
<div class="box"></div>
</body>
</html>
CSS CODE
.box {
width: 100px;
height: 100px;
background: red;
margin: 100px 5px;
float: left;
}
.box:nth-child(1){
background: black;
float: right;
}
body{
width: 100%;
min-height: 100vh;
background:linear-gradient(blue, #fff) ;
}
0 Comments