Question:

I need help with my div box positioning!?

by  |  earlier

0 LIKES UnLike

i have them mainly where i want them but if i change the size of the screen the boxes move and sometimes are cut out all together. how do i fix their positions to stay in the same spot relative to the background no matter what size the screen is?

 Tags:

   Report

1 ANSWERS


  1. <style>

    body{

    background-position: center center;

    }

    div#divid{

    position: absolute;

    left: 50%;

    top: 0px;

    margin-left: -(half of whatever div box size is)px;

    }

    </style>

    thats for centering with a bg

    or for possibly what yoru talking about, you have to align the background left, then position it from there

    <style>

    body{background-position: top left;}

    div#divid{

    position: absolute;

    top: px;

    left: px;

    }

    </style>

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions