Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to center two divs considering the different resolutions of users
    primarykey
    data
    text
    <p>Im a newbie in css and Im having trouble centering two divs. I have a 1920 x 1080 screen resolution and using margin will not center the two divs if the visitor of my website have lower resolution. I know it will moved, right?</p> <p>Details:</p> <p>Please take a look at my problem here ---> <a href="http://i1204.photobucket.com/albums/bb409/bendaggers/help.png" rel="nofollow">http://i1204.photobucket.com/albums/bb409/bendaggers/help.png</a></p> <ul> <li>Div id = Topwrapper</li> <li>Div id = MainWrapper: holds the container and sidebar (gray)</li> <li>Div id = Container (yellow green)</li> <li>Div id = Sidebar (blue)</li> </ul> <p>I have no problem with the Topwrapper, as you can see, it is in the center position but my very big problem is the Container and Sidebar. I cant align it with the Topwrapper. can you help me code? Another thing, can you please consider the screen resolution, as far as i know, my Mainwrapper code will adjust its width because of the min-width=1000px;</p> <p>If you think you have a better idea with my codes, please feel free to revise it.</p> <pre><code> &lt;div id="TopWrapper"&gt;&lt;/div&gt; &lt;div id="MainWrapper"&gt; &lt;div id="Content"&gt;&lt;/div&gt; &lt;div id="Sidebar"&gt;&lt;/div&gt; &lt;/div&gt; #MainWrapper { height:3000px; min-width:1000px; background-color:#CCC; } #TopWrapper { background-image:url(images/topwrapper.png); background-repeat:no-repeat; background-position: center bottom; min-width:100%; height:77px; margin: 0; } #Content { height:3000px; min-width:630px; background-color: #0F0; float:left; margin-left:150px; display:inline; } #Sidebar { height:3000px; min-width:350px; background-color: #00F; margin-left:20px; float:left; display:inline; } </code></pre> <p><strong>Thank you very much in advance!</strong> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload