Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Feb 2004
    Posts
    76
    Member #
    4909
    I am re designing my site so that it complies to web standards, I have marked up the site in HTML 4.01 and used CSS to style and position the elements. And it all works even on mobile devices

    The problem is that I want to center everything in the middle of the page. This is the site. It is absolutly positiond so it wont budge even with a crow bar, but i want to center it reletave to the size of the browser window.

    CAn some one please help?

    Cheers

  2.  

  3. #2
    Senior Member jlgosse's Avatar
    Join Date
    Jan 2004
    Location
    Newfoundland, Canada
    Posts
    1,037
    Member #
    4570
    Liked
    7 times
    I Believe that using Absolute positioning makes it impossible to center it like that.


  4. #3
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Code:
    element {
      position: absolute;
      width: 400px; /* width of element */
      left: 50%; /* move the left edge to the center of the container */
      margin-left: -200px; /* back the element up half its own width */
    }
    or

    Code:
    element {
      width: 400px;
      margin-left: auto;
      margin-right: auto;
    }
    should work


  5. #4
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Yeah, don't use absolute positioning for stuff like that.. it'll come back to bite ya

    glakk's method should work, or use something like at www.bluerobot.com
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  6. #5
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    one of my solutions uses absolute positioning.......



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:22 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com