Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    1
    Member #
    29590
    hi all new to this site, after a brain hemorrhage last year, i'm attempting to remember how to work with html, i'm really having problems with getting my site to be centered in any browser, to be honest i'm feeling a bit stupid at the moment, there was a time when i could code quite well, can anyone help me please, i think i need step by :help:

  2.  

  3. #2
    Member christopher_b's Avatar
    Join Date
    Aug 2011
    Location
    Pretoria, South Africa
    Posts
    69
    Member #
    29042
    Liked
    7 times
    Hey, and welcome to the site. The easiest way to center a site is to add your entire site content into one div.

    HTML Code:
    .center {
      width: 960px; a width MUST be specified
      margin: 0 auto; this centers the div
    }
    
    <div class="center">
    All your page html goes inside this div.
    </div>
    If you do not understand what I showed, then just let me know,

    Cheers.

  4. #3
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    What he said ^^. Just put all your content into one div like this.

    <div id="container">

    <div id="something">
    </div>

    <div id="something">
    </div>

    <div id="something">
    </div>

    <div>

    then in your css:

    #container{
    margin: 0px auto 0px auto;
    }

    And there you go. All centered
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs



  5. #4
    WDF Staff m3n0tu18's Avatar
    Join Date
    Jul 2011
    Location
    Devon, UK
    Posts
    1,473
    Member #
    28473
    Liked
    265 times
    Quote Originally Posted by Andrew Yurlov, post: 221612
    What he said ^^. Just put all your content into one div like this.

    <div id="container">

    <div id="something">
    </div>

    <div id="something">
    </div>

    <div id="something">
    </div>

    <div>

    then in your css:

    #container{
    margin: 0px auto 0px auto;
    }

    And there you go. All centered
    close but having a div id of something 3 times is not a good idea. if the box something was a div it should be a class so it would be <div class="something"></div> that way it authenticates through xhml validator correctly
    If you like my comments to your thread please click the LIKE button

    Check out my portfolio: Here!
    View my company Facebook Page
    View my company Website

    <<Plrease ignoer my typo's I have isdexlyia>>

  6. #5
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    Quote Originally Posted by m3n0tu18, post: 221633
    close but having a div id of something 3 times is not a good idea. if the box something was a div it should be a class so it would be <div class="something"></div> that way it authenticates through xhml validator correctly
    I did example because I didn't know what he has there. I didn't litterally mean to do 3 identical div id's.
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs




Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:43 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com