1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need HTML content centred in browser

Discussion in 'Hire a Freelancer' started by lafours, May 11, 2012.

  1. lafours

    lafours Power Member

    Joined:
    Sep 15, 2008
    Messages:
    576
    Likes Received:
    334
    I have some HTML content I need centring regardless of screen resolution. Not with <center> tags as that will centre the text format too. I need all the div's centred. Easy $5 paypal for someone. Skype LafoursBHW.
     
  2. 0wned

    0wned Newbie

    Joined:
    Jul 14, 2009
    Messages:
    26
    Likes Received:
    21
    Occupation:
    Web Developer
    Location:
    London
    You should just be able to add

    Code:
    margin: [COLOR=#800000]0[/COLOR] [COLOR=#00008B]auto[/COLOR];
    
    to the container elements css.

    If you have any troubles pm me and ill take a look free of charge.
     
    • Thanks Thanks x 1
  3. geomuss

    geomuss Regular Member

    Joined:
    May 19, 2011
    Messages:
    243
    Likes Received:
    110
    As long as you body has a width say 960px
    as above just add margin: auto; to the css of the wrap container (container that holds all the information)

    if you dont know what your looking for hit me up or the guy above
    and well help.

    No money needed for these things but if your feeling generous there was a thread earlier
    about a guy down on his luck, maybe a $5 donation to his paypal acct would be great.
    Just a thought
     
    • Thanks Thanks x 1
  4. Cas87

    Cas87 Regular Member

    Joined:
    Mar 5, 2012
    Messages:
    286
    Likes Received:
    131
    Location:
    England
    Depending on how your content is positioned, you could also use...

    Code:
    [COLOR=#40e0d0]margin-left[/COLOR]: auto;
    [COLOR=#40e0d0]margin-right[/COLOR]: auto;
    
    This way, you can set a specific top &/or bottom margin for your content if you need to..
     
    • Thanks Thanks x 1
  5. dvL-den

    dvL-den Newbie

    Joined:
    Jan 26, 2012
    Messages:
    6
    Likes Received:
    2
    Home Page:

    Exactly that... So for an example if you're positioning an image, your code would be like this:

    Code:
    #myImage {
    background-image: url("link");
    background-repeat: no-repeat;
    width: 379px;
    height: 400px;
    margin: 0 auto;
    }
    
    Now depending on where you adding your content you should always have an wrapper, like other people mentioned.

    For example:
    Code:
    #wrapper {
    width: 850px;
    height: 600px;
    position: relative;
    margin: 0 auto;
    }
    
    Well thats pretty much it... add div id's in your html doc and enjoy. Added you into skype, in case you havent found anyone yet.
     
    • Thanks Thanks x 1
  6. lafours

    lafours Power Member

    Joined:
    Sep 15, 2008
    Messages:
    576
    Likes Received:
    334
    Wow! Only on BHW would you offer cash and get free help :) Thanks guys, I'll give it a go this afternoon and get in touch if I fail... Thanks again, can't believe the generosity of this place.
     
  7. waynegomez

    waynegomez Newbie

    Joined:
    May 15, 2012
    Messages:
    27
    Likes Received:
    0
    margin:0 auto; is standard,.....
     
  8. lafours

    lafours Power Member

    Joined:
    Sep 15, 2008
    Messages:
    576
    Likes Received:
    334
    Thanks for all your help. This is now resolved with the help of the legendary geomuss.