How to make the Website to be like center of the page?

Discussion in 'HTML & Website Design' started by jackyrocks, Feb 17, 2008.

  1. #1
    How to make a website to be center of the page.. ?
    please Advice.. We can do in Dreamweaver, or is there any code.. or how its done?
     
    jackyrocks, Feb 17, 2008 IP
  2. ariyes

    ariyes Notable Member

    Messages:
    1,123
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    245
    #2
    do u use CSS ? then u can do it easily. just setup the margin.

    if u need any help PM me.
     
    ariyes, Feb 17, 2008 IP
  3. amazingronit

    amazingronit Well-Known Member

    Messages:
    1,334
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Easy if you have a table based layout. just set the width of the biggest (main) table to <100% or <1000px and write align="centre" . that's it!
     
    amazingronit, Feb 17, 2008 IP
  4. bernard_w

    bernard_w Guest

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Another solution, if you want that all content to be centered:
    Put after <body> this:

    
    <div style="width: xx px; margin: 0 auto 0 auto;">
    
    Code (markup):
    And before </body this:

    
    </div>
    [/div>
    
    And change xx px with your width. It will work.
    Code (markup):
     
    bernard_w, Feb 17, 2008 IP
  5. nicangeli

    nicangeli Peon

    Messages:
    828
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well you could wrap the entire of the site in a div, like so,

    html,
    
    
    
    <div id="center">
    <!-- Your contents here -->
    
    
    </div>
    
    
    Code (markup):
    Then in your css file,

    
    #center
    {
    margin: auto;
    text-align: center;
    width: 50%;
    }
    
    
    Code (markup):
    The text-align is required for the site to center in IE6, the width defines how wide the site will be...
     
    nicangeli, Feb 17, 2008 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Text-Align is required for Internet Explorer 5. When in standards mode, Internet Explorer 6 will use margin: 0 auto; combined with a width (like the other browsers do). Fortunately this is VERY easy to do - just use a complete and proper DOCTYPE declaration with nothing (not even white space) above it.
     
    Dan Schulz, Feb 17, 2008 IP