45 users online (0 members and 45 guests)  


  Results 1 to 11 of 11

Related

  1. Content Stays Centered on web page.    Forum: HTML Forum
    Replies: 6
  2. Centered Pages?    Forum: HTML Forum
    Replies: 4
  3. Align text to Centered table    Forum: HTML Forum
    Replies: 6
  4. Having web content always centered    Forum: HTML Forum
    Replies: 3
  5. Replies: 15
  1. #1
    dbnearsf's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2011
    Posts
    5

    Getting Web Page to Appear Centered in Browsers

    www.CollegeSolutionsUSA.com

    Would like to get the pages at the website above to appear centered in browsers, as opposed to sticking to the left (in IE, anyway).

    Is there some code I could apply to individual pages, as opposing to utilizing CSS?

    Many thanks!

    P.S. I did search this website for the answer to my question. It appears that an answer may have previously been posted. I could find the thread with the question but could not see the answer there.
    Last edited by HTML; 09-14-2011 at 06:51 AM.

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Getting Web Page to Appear Centered in Browsers

    Hi there dbnearsf,

    and a warm welcome to these forums.

    Add the highlighted in red attribute...
    Code:
    
    #maintable {
    	width: 770px;
    	text-align: left;
            margin:auto;
     }
    

  3. #3
    dbnearsf's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2011
    Posts
    5

    Re: Getting Web Page to Appear Centered in Browsers

    Quote Originally Posted by coothead View Post
    Hi there dbnearsf,

    and a warm welcome to these forums.

    Add the highlighted in red attribute...
    Code:
    
    #maintable {
    	width: 770px;
    	text-align: left;
            margin:auto;
     }
    
    Thanks very much for the warm welcome (and your response)!

    Hmmn ... looks like a need a bit more help, please.

    I searched the code for the part of the configuration minus the line in red but could not find it anywhere in the source code.

    Am I correct in assuming that your instruction is to find that part of the code that is in blue here (starting with #maintable) and insert the line in red at the end?

    If so, any ideas on why I can't seem to find that existing configuration? I tried searching using Edit/Find.

    Thanks again!

  4. #4
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Getting Web Page to Appear Centered in Browsers

    Hi there dbnearsf,

    you will find the code in your CSS file here...

    Just open it with NotePad and edit it as suggested.

  5. #5
    dbnearsf's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2011
    Posts
    5

    Smile Re: Getting Web Page to Appear Centered in Browsers

    Quote Originally Posted by coothead View Post
    Hi there dbnearsf,

    you will find the code in your CSS file here...

    Just open it with NotePad and edit it as suggested.
    AH, the CSS file!

    That was it: it worked!

    FANTASTIC. Can't thank you enough. God bless you.

  6. #6
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Getting Web Page to Appear Centered in Browsers

    No problem, you're very welcome.

  7. #7
    dbnearsf's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2011
    Posts
    5

    Re: Getting Web Page to Appear Centered in Browsers

    Just out of curiosity, is there any practical difference between the code you provided and this:

    #maincontainer
    {
    position:relative;
    margin:auto;
    width:770px;
    padding:0px;
    }

    Knowing where to look prompted me to look up a page on a site that was centered.

    Thanks again!

  8. #8
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Getting Web Page to Appear Centered in Browsers

    Hi there dbnearsf,

    there is no practical difference, as far as horizontally centering a container is concerned.

    As long as the container has a specified width, margin:auto will center it.

    Note, though, that IE browsers will not render margin:auto in "Quirks Mode", so make
    certain that you always use a full valid DOCTYPE.

  9. #9
    dbnearsf's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2011
    Posts
    5

    Re: Getting Web Page to Appear Centered in Browsers

    Thanks again!!!

  10. #10
    firestone's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2011
    Posts
    13

    Re: Getting Web Page to Appear Centered in Browsers

    nice guys your response for query is awesome any one please help me to learn j2me

  11. #11
    stephen011's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2011
    Location
    Santa Ana,CA, USA
    Posts
    21

    Re: Getting Web Page to Appear Centered in Browsers

    Hi use this code
    <div align="center">your content here</div>

    But it is not good idea for Web Page to Appear Centered in Browsers.Because it will generate more space insite your webpage.It will not be userfriendly.