CSS BOX PLAYGROUND
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>CSS LEVEL 3</title>
<link rel="stylesheet" href="STLE.CSS">
</head>
<body>
<h1>Position Playground</h1>
<div id="box1" style="background-color: pink;">box1</div>
<div id="box2" style="background-color: red;">box2</div>
<div id="box3">box3</div>
<div id="box4" style="background-color: green;">box4</div>
</body>
</html>
CSS
div{
height: 100px;
width: 100px;
background-color: aqua;
border: 2px solid gold;
display: inline-block;
}
#box1{
position: relative;
top: 10px;
}
#box3{
position: sticky;
top: 0;
}
#box4{
bottom: 0;
}
#box1{
background-image: url(Acer.jpg.jpg);
height: 350px;
width: 350px;
background-size: cover;
}
OUTPUT
Position Playground
box1
box2
box4 box3
Comments
Post a Comment