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
    May 2008
    Posts
    65
    Member #
    16874
    Hi all,
    I'm new to WD. I created a simple mockup in Photoshop and brought it into DW.
    At first I had the page in the center in DW and centered in Firefox with the div. I don't know what I did, but when I view it in the browser it's no longer centered.
    There is a div#container and table. The #container box is width 835, Margins are right auto and left auto.

    Anyone what to do to make it center in the browser?

    Thanks for your help

  2.  

  3. #2
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    body{text-align: center;}
    #wrapper{margin: 0 auto; text-align: left;}

    This should center in IE and Firefox, include both.

  4. #3
    Member
    Join Date
    May 2008
    Posts
    65
    Member #
    16874
    Bingo! Thanks

  5. #4
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    no problem.

    margin: 0 auto; centers in compliant browsers.

    IE uses text-align to also center elements (which its not supposed to)
    To center an element you set text-align: center on teh parent container. Since this is a wrapper the parent is body.

    body{text-align: center;}
    This aligns all elements and text in the body center, but we dont want the text centered!
    #wrapper{text-align: left;} this offsets it

    glad i helped

  6. #5
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    { position: relative; margin: 0px; margin-left: auto; margin-right: auto; } position absolute doesnt allow for auto margin as far as i know and IE disregards shorthand.

    while($get_it !== true){ continue; }


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 11:23 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com