CSS Position Property Part – 1

Full Stack Web Development Courses with Real-time projects Start Now!!

Program 1

<html>
    <head>
        <style>
            /*div{
                border:2px solid black;
                position:relative;
                top:10;
                left:20;
                right:50;
                width:400px;
                
            }*/
            div{
                border:2px solid black;
                position:fixed;
                top:0;
            }
            /*.parent{
                position:relative;
            }
            .child{
                position:absolute;
                top:0;
            }

            p{
                position:absolute;
                top:0;
                left:80;
            }*/
        </style>
    </head>
    <body>
       <!--<div class="parent">
        Parent element
        <div class="child">
            Child element
        </div>

       </div>-->
       <!--<img src="C:\\Users\\Lenovo\\Downloads\\bird.jpg">
       <p>Bird</p>-->
       <div>
        This is fixed
       </div>
       <p style="margin-top:2000px;">This is some text</p>

    </body>
    </html>

 

You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *