SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict mixmastermidori's Avatar
    Join Date
    Sep 2001
    Posts
    337
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Center aligning columns

    This is my first time using CSS to make a table-less page. I used absolute positioning to get my two columns the width apart that I like and to place them on the page. However, now I want them to move as a unit, the same width apart, but being more flexible as the browser window changes size so that they're always in the center of the window.

    Right now, I have this as my code for the two columns, which are placed within a main <div> saying the width and background color of the main area:

    #content {
    position:absolute;
    top:320px;
    left:25px;
    margin-bottom: 80px;
    background: #FFFFCC;
    width:450px;
    border: 2pt dotted #FFFFFF; margin:0px 0px 0px 0px; padding:10px;
    font: 8pt verdana, arial, helvetica, sans-serif; font-weight: normal;
    }

    #sidebar {
    position:absolute; top:320px; left:500px; width:200px; padding:5px; background: #FFFFCC; border: 2pt dotted #FFFFFF; margin:0px 0px 0px 0px; padding:10px;
    font: 8pt verdana, arial, helvetica, sans-serif; font-weight: normal;
    }

    Thanks for any help!
    -Midori
    Nature's Sunshine herbs and supplements

  2. #2
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry, I'm not exactly sure, but one of the following sites could definitely help you. They're all sites that contain CSS layouts and the code to achieve those layouts. Perhaps you could find your solution by examining some of that code.

    http://www.bluerobot.com/web/layouts/
    http://www.thenoodleincident.com/tut...son/boxes.html
    http://www.glish.com/css/#techniques

    I hope those help!
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  3. #3
    SitePoint Addict mixmastermidori's Avatar
    Join Date
    Sep 2001
    Posts
    337
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks so much for the links! It looks exactly like what I need.

    Take care,
    Midori
    Nature's Sunshine herbs and supplements


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
  •