Web Page htm Alignment?!

Discussion in 'HTML & Website Design' started by Truffels_R_Us, Dec 14, 2007.

  1. #1
    I had a design made which is a Webpage File, does anyone have any idea how to centralize it? I have frontpage and have been trying to do it there but with no joy, even selecting it and pressing the centre text does nothing! if someone can tell me I will pass a couple of $ your way through Paypal...

    Here is the site, as you can see it is stuck to the left! :cool:

    New Landing Page
     
    Truffels_R_Us, Dec 14, 2007 IP
  2. agilius

    agilius Well-Known Member

    Messages:
    1,021
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    100
    #2
    the easy way is to "warp" a <div> around everything and set it's align attribute to center.
     
    agilius, Dec 14, 2007 IP
  3. Truffels_R_Us

    Truffels_R_Us Well-Known Member

    Messages:
    462
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    133
    #3
    :eek: Can you explain how I do that step by step? or is it possible for you to do that if I send the htm file to you?
     
    Truffels_R_Us, Dec 14, 2007 IP
  4. Truffels_R_Us

    Truffels_R_Us Well-Known Member

    Messages:
    462
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    133
    #4
    I found a similar site and viewed the source code and changed my first line to this:

    <table class="XSP_OUTLINE" align="center" cellpadding="0" cellspacing="0" border="0">
    <tr>

    It's done the trick!!!
     
    Truffels_R_Us, Dec 14, 2007 IP
  5. TDD-Designs

    TDD-Designs Peon

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    tables aren't good.

    at the start of your <body> tag add "<div align="center"> so it'll be like this:

    "<body><div align="center">everything for the page</div></body>"
     
    TDD-Designs, Dec 14, 2007 IP
  6. agilius

    agilius Well-Known Member

    Messages:
    1,021
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    100
    #6
    hehe, I only saw the last replay after writing half of my post... Glad you did it m8. Keep it up!
     
    agilius, Dec 14, 2007 IP
  7. Truffels_R_Us

    Truffels_R_Us Well-Known Member

    Messages:
    462
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    133
    #7
    Thanks Guys, I tried your ideas but as it has an added background, using the div wraps were causing the background to appear as text above the main table! this appears to be working now so I will stick with what I found.

    Many Thanks for the Help...
     
    Truffels_R_Us, Dec 14, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You guys have it all wrong, especially with the abuse of layout tables and the use of deprecated (read: obsolete) markup.

    The first thing you need to do is use a proper and complete DOCTYPE. Since you're using old-fashioned HTML, I suggest you start by adding the following to the very TOP of your Web page, just above the opening HTML tag:

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    
    Code (markup):
    Then add lang="en" to the <html> tag so it looks like this:

    
    <html lang="en">
    
    Code (markup):
    Then wrap your entire table around a <div></div> container and give that DIV an ID of "container".

    After that, go to the head section of your page (where the META tags are), and add this:

    
    <style type="text/css">
    <!--
    	#container {
    		margin: 0 auto;
    		width: 600px;
    	}
    -->
    </style>
    
    Code (markup):
    But as it is, your page needs a complete rewrite from the ground up anyway.
     
    Dan Schulz, Dec 14, 2007 IP