View Full Version : 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
YouFail
03-04-2007, 06:02 PM
Make it:
width: 98%;
padding: 1%;
Luckyrare
03-04-2007, 06:06 PM
Make it:
width: 98%;
padding: 1%;
Yuh, its simple maths Tom :rolleyes: <3
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 :)
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 ''/
Mentor
03-04-2007, 06:20 PM
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.
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 ^^
CSS is an ace game whats your username...sorry I couldnt resist...
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.