banner centred and text justified to left. How to?

Discussion in 'HTML & Website Design' started by thewizardofodds, Aug 10, 2008.

  1. #1
    i have a page with a banner at top and writing undeneath.
    My problem is that i want the banne in the centre and the text underneath justified to the left.
    at the moment when I centre the banner the text is centred too.
    any help appreciated.
     
    thewizardofodds, Aug 10, 2008 IP
  2. 50plus

    50plus Guest

    Messages:
    234
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It seems that your text is included between the center tags of your banner. Move your text below the closing center tag.

    Unless you are using a table in which case start your text in a new row.
     
    50plus, Aug 10, 2008 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    1. Use a proper doctype, with nothing before it (no spaces, comments, newlines, anything that can set IE into Quirks mode).

    2. Make the banner a block, if it isn't one. Set a width on it.

    3. in CSS, refer to the banner and center it with margin: 0 auto;

    4. in CSS, find the reference to your text, OR if you just want it for the whole page, you could add it to the body tag: text-align: left;

    text-align: left is actually a default, so I'm assuming you are using text-align: center to center things. 50plus might be correct that you are using <center> tags-- if you are, get rid of them. They have no place in modern code. Text-align: center will center inline elements (like <a> and <img>) while a width and margin: 0 auto will center blocks. If your banner is already in a block like a <div>, then you could just set the width of your banner to the div instead, and then center it with margins.

    Text-align: center will also center blocks in Internet Exploder 5.5 and below, as well as IE6 and 7 if you have set them into Quirks Mode (see #1 above). If things are centered this way, you should see no centering in FF, Opera, or Safari, or any other modern browser.
     
    Stomme poes, Aug 11, 2008 IP
  4. bobbydeo

    bobbydeo Peon

    Messages:
    65
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    use tables with banner in one row and text in the row below it. Then you can align the text and banner whichever way you want.
     
    bobbydeo, Aug 11, 2008 IP