Press "Enter" to skip to content

Position Examples in CSS

Last updated on October 5, 2019

Definition :

      The position property specifies the type of positioning method used for an element (static, relative, absolute, fixed, or sticky).

Program :

<html>

     <style type=”text/css”>

                     #Second

                                 {

                                   color: blue;

                                   width:100px;

                                   height:100px;

                                   margin-left:1000px;

                                   position: relative;

                                 }

                </style>

                <body>

                     <table border=”1″ bordercolor=”red” width=”100″ height=”100″>

                                     <tr>

                                                     <td> Hello </td>

                                                                 <td id=”Second”> HI </td>

                                                </tr>

                                </table>

                </body>

</html>

Be First to Comment

    Leave a Reply

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