position in the css

technical talkiess
0

 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Position in css</title>
</head>
<style>
    .container{
        background-color: khaki;
        height: 3200px;
        width: 100%;
        border: 1px solid black;
        overflow: none;
    }
    .box{
        display: inline-block;
        background-color: aqua;
        margin: 2px;
        height: 100px;
        width: 250px;
        border: 1px solid black;
    }
    /* position :- static(default),relative,absolute,fixed,sticky */
    #box3{
        /* position:- relative position relative their own place and move and gap the own position */
        /* position: relative; */
        /* positin absolute :- Position absolute its depends the parents and leave their position  */
        /* position: absolute; */
       
        /* positin fixed :- Position fixed its fixed the itself  */
        /* position: fixed; */
       
        position: sticky;
        bottom: 2px;
        top: 2%;
        /* left: 35px; */
    }
</style>
<body>
    <div class="container">
        <div class="box" id="box1">1</div>
        <div class="box" id="box2">2</div>
        <div class="box" id="box3">3</div>
        <div class="box" id="box4">4</div>
    </div>
</body>
</html>
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)