HTML Question

Discussion in 'Software' started by bjgarrick, Aug 6, 2006.

  1. bjgarrick

    bjgarrick MajorGeeks Admin - Malware Expert

    I have a question regarding an HTML code that I hope exist. I'm looking for a code that will make my site "center" no matter what screen resolution you have. Right now my site is center when screen resolutions settings are 800 x 600, if you have anything other than this it's not center, it's to the left.

    Is there a script I can add to my page that will center the site no matter what resolution you have?
     
  2. matt.chugg

    matt.chugg MajorGeek

    in IE using <body style="text-align:centre;"> will work, but this won't work in firefox

    To make the same thing happen in firefox and other more compliant browsers you need to use the following or similair CSS

    Code:
     body    {
        text-align:center;
        width:700px;
        margin:5px auto 0px auto;
        }
    
    I've been working on a new site for my program and have managed to get CSS that will line everything up right in IE6,FF,IE7,Opera (I think), flock

    The site (under construction) is here http://ychatsharp.com/keyfinderthing

    the Stylesheet is here http://ychatsharp.com/keyfinderthing/mainstyles.css

    Feel free to use anything you want
     
  3. bjgarrick

    bjgarrick MajorGeeks Admin - Malware Expert

    Are you saying in my code, if I enter the quote below it will center my site in IE no matter what screen resolution you have?

     
  4. matt.chugg

    matt.chugg MajorGeek

    yes

    replace your opening body tag with that it applies a style to the body, but will have the side effect of centering everything, you need to then apply styles to the other parts of the page to put it back to the left or right.
     
  5. bjgarrick

    bjgarrick MajorGeeks Admin - Malware Expert

    I'll try it and see what happens.
     
  6. bjgarrick

    bjgarrick MajorGeeks Admin - Malware Expert

    I don't think I understand that last part? Anyway, I tried adding this line and for some reason it didn't work. I'm not sure what's going on with my code. I think someone has messed with it and didn't tell me.
     
  7. matt.chugg

    matt.chugg MajorGeek

    you want to show me the code and i'll take a look ?
     
  8. ShockTroop

    ShockTroop Specialist

    Maybe that line didn't work because "centre" is spelled "center". :p
     
  9. matt.chugg

    matt.chugg MajorGeek

    oops, language error lol.
     
  10. petemate

    petemate Private First Class

    Hmm... on a similar subject, I've been having trouble with centering a music profile on the dreaded myspace. A little help would put an end to hours of headaches.

    I nabbed the code from tiatequila and messed with it a bit, but even in it's original form, it won't center like it does with hers.

    Please could someone help out with this? I've tried the css : <style type="text/css">table table table table table {direction:rtl;}
    table table table table table td {direction:ltr;}
    </style> but had no luck.

    Thanks.
     

    Attached Files:


MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds