Results 1 to 7 of 7

Thread: Position code mess ups according to screen size...

  1. #1
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Exclamation Position code mess ups according to screen size...

    I have a problem. My website layout is made using DIV position codes. However, my background that has a white strip down the middle is set to "center". So it will look perfect on my computer and like this on other screen resolutions. I need a way to center my "headerdiv" and my "contentdiv" and "sidebardiv". If there are other ways to fix this problem I am all ears. Here are my DIV codes, as well as my background code:
    Code:
    body {
    text-align : right;
    margin : 0;
    background : url(http://www.modernrevolutions.vivid-avenue.net/layout/awesomebar.jpg) repeat-y;
    background-position : top center;
    
    div#headerdiv {
    position : absolute;
    top : 0px;
    left : 274px;
    width : 715px;
    height : 322px;
    background-image : url('http://www.modernrevolutions.vivid-avenue.net/layout/megan.png');
    border : 0;
    border-style : solid;
    }
    
    
    div#sidebardiv {
    position : absolute;
    left : 755px;
    top : 350px;
    width : 220px;
    height : 550px;
    border : 0;
    border-style : solid;
    font-family : arial;
    font-size : 11px;
    }
    
    
    div#contentdiv {
    position : absolute;
    left : 300px;
    top : 350px;
    width : 450px;
    height : 1100px;
    font-family : georgia;
    font-size : 11px;
    line-height:13px;
    text-align : left;
    }
    ------------------
    Check out my site here and let me know what you think

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Wrap everything in a div and give it the following CSS rules:
    Code:
    div.wrap {
    margin: 0 auto;
    width: 715px;
    }
    Good luck!

  3. #3
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    So i put that in my CSS and it should fix the problem? Do i have to put anything in my header or anything?
    ------------------
    Check out my site here and let me know what you think

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You should also wrap all the content in the body with a div, like this:
    Code:
    <body>
    <div class="wrap">
    Everything here
    </div>
    </body>
    Then you just add the CSS code, you don't need to change anything in your header.

  5. #5
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    my body is in my header :?

    here is what it looks like: site, header, stylesheet.
    ------------------
    Check out my site here and let me know what you think

  6. #6
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Sorry?? Now I'm confused
    Just wrap everything inside the body tags with the wrapping div and add my CSS code to your CSS code.

  7. #7
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    I added the CSS code into my stylesheet (CSS). And everything in my site is mostly in my header. So i wrapped everything in my body tags in the div wrap thing. However, i'm not at school anymore, so I can't check with that screen resolution :/ Hopefully it worked

    Edit: Okay, I went to browsershots.org, and in EVERY screenshot, everything is shifted to the right. So it didn't work :/ Here are my screenshots :/
    Last edited by ModernRevolutions; 04-09-2009 at 04:18 PM.
    ------------------
    Check out my site here and let me know what you think

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •