View Full Version : When using padding it repeats the div (image)??
iDenning
09-03-2012, 07:04 PM
Hey
Im currently coding a layout and when Im using padding-bottom/padding-left it repeats the image instead of actually making space?
How can I stop/fix this?
Cheers! Help appreciated!
Chippiewill
09-03-2012, 07:48 PM
try margin instead. Padding just affects content within a div.. I think.
iDenning
09-03-2012, 08:09 PM
try margin instead. Padding just affects content within a div.. I think.
It worked, thanks! Cant believe I didnt think of that in first place lol, +rep
Chippiewill
09-03-2012, 09:59 PM
It worked, thanks! Cant believe I didnt think of that in first place lol, +rep
I only remembered because I always screw it up myself ;)
Qzaki
09-03-2012, 10:32 PM
Margin is outside
Padding is inside
Recursion
10-03-2012, 01:53 AM
You could also fix this with the CSS background repeat property... assuming you're talking about the background.
http://www.w3schools.com/cssref/pr_background-repeat.asp
I think you can correct it by modifying the Width in terms of the padding. So if you have 5px padding your subtract 5px of the width of the image.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2026 vBulletin Solutions Inc. All rights reserved.