header is not centered on higher resolution

Discussion in 'HTML & Website Design' started by shamrock36, Oct 20, 2006.

  1. #1
    Hi,
    I'm making this header,
    it is suitable for 1024*768, but I've just figured that on higher resolutions, the header would not be centered, I've tried adding:
    style="background-position: center", but then figured that the text and the banner would be misplaced on one of the resolutions.

    any ideas how to do this? or is there a complete different way?

    thanks!
     
    shamrock36, Oct 20, 2006 IP
  2. sawz

    sawz Prominent Member

    Messages:
    8,225
    Likes Received:
    808
    Best Answers:
    0
    Trophy Points:
    360
    #2
    why can't you just <center></center> it?
    looks nice btw
     
    sawz, Oct 20, 2006 IP
  3. shamrock36

    shamrock36 Active Member

    Messages:
    180
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    thanks... ummm where exactly in the code should I put the <CENTER>? I don't think it would effect the header itself because its a backgroudn image for a cell.....
     
    shamrock36, Oct 20, 2006 IP
  4. missdanni

    missdanni Guest

    Best Answers:
    0
    #4
    You could just center your whole table
    <CENTER><TABLE etc etc etc>

    </TABLE></CENTER>
     
    missdanni, Oct 20, 2006 IP
  5. iatbm

    iatbm Prominent Member

    Messages:
    5,151
    Likes Received:
    352
    Best Answers:
    0
    Trophy Points:
    360
    #5
    ahh tables ... go with css make header div and just margin it to : 0 auto and text-align center and you have it for all resolutions
     
    iatbm, Oct 20, 2006 IP
  6. shamrock36

    shamrock36 Active Member

    Messages:
    180
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #6
    I've tried centering the whole table, it doesn't work :(
    no matter how I've tried to play with it, it would look good only in one of the resolutions 1024*768 or 1280*1024....

    I'm not sure how to do it with css:

    here's the code, what do I have to add to it?

    <DIV><img src="header1.jpg"></DIV>
    <DIV class="banner"><img src="mario52.gif"></DIV>
    <DIV class="nav">Home | Chat Forums | Chat Guide | Fun Stuff | Online Dating | Contact Us</DIV>
     
    shamrock36, Oct 21, 2006 IP
  7. shamrock36

    shamrock36 Active Member

    Messages:
    180
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #7
    anyone? :)
     
    shamrock36, Oct 23, 2006 IP
  8. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #8
    
    #main {
        width: 90%; /*or whatever width you prefer*/
        margin: 0 auto;
        }
    ========
    <table id="main">
      ... the page
    </table>
    Code (markup):
    Be sure to use a complete and proper DTD so that IE recognizes {margin: auto;}.

    cheers,

    gary
     
    kk5st, Oct 23, 2006 IP