Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8

Thread: CSS Padding

  1. #1
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default CSS Padding

    Hey,

    I have a div that goes all the way along the top of the page (width: 100%). But I need to pad the div else the text is too close to the edges (padding: 1px) but if I add padding I get scroll bars.

    How can I solve this?

    Thanks,

    Tom

  2. #2
    Join Date
    Mar 2006
    Location
    Scotland
    Posts
    1,012
    Tokens
    175

    Latest Awards:

    Default

    Make it:

    width: 98%;
    padding: 1%;


    You don't like me
    Chances are I don't like you.

  3. #3
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by RichardKnox View Post
    Make it:

    width: 98%;
    padding: 1%;
    Yuh, its simple maths Tom :rolleyes:

  4. #4
    Join Date
    Mar 2007
    Location
    Ipswich
    Posts
    115
    Tokens
    0

    Default

    Quote Originally Posted by RichardKnox View Post
    Make it:

    width: 98%;
    padding: 1%;
    Yeah, change the padding to % and make the width smaller.

    If you were to make the padding 2%, the width would be 96%, cause you'd be taking 2% off each side.

    Hope this helps

  5. #5
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Actually it appears to work.. apart from now in IE my text it at the top and in FF my text is at the bottom ''/
    Last edited by Tomm; 03-04-2007 at 06:19 PM.

  6. #6
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Remove the width 100% from the div, divs by defult will exstend accross the entire width of the page, unless you put somthing in the way, or constrain it with a width attribute.
    Remioveing that should also get rid of your padding problems, aka meaning you can supply the padding in px.
    if that doesnt work, just change the overflow hidden or somthing to avoid scroll bars.

  7. #7
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by 01101101entor View Post
    Remove the width 100% from the div, divs by defult will exstend accross the entire width of the page, unless you put somthing in the way, or constrain it with a width attribute.
    Remioveing that should also get rid of your padding problems, aka meaning you can supply the padding in px.
    if that doesnt work, just change the overflow hidden or somthing to avoid scroll bars.
    Removing it messes up my bg ^^

  8. #8
    Oni Guest

    Default

    CSS is an ace game whats your username...sorry I couldnt resist...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •