Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • To make the absolute position of block in center with respect to parent block using css only.

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 387
    Comment on it

    If you want to make the absolute position of the block in center from all the sides with respect to parent block using css only.

     <style>
              .base{ width:900px; height:500px; position:relative;background:#dddddd}
              .top{ width:100px; height:100px; position:absolute;top:0px; left:0px; right:0px; bottom:0px;   margin:auto;background:#bdbc9d}
        </style>       
        <div class="base">
              <div class="top"></div>
        </div>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: