Hey All,
This may sound stupid, but how come when I set a DIV's padding, it pushes out of its boundaries, I though padding was only used within the element, to keep text and images away from the edges etc? Am I supposed to add padding to something other than the DIV containing the content?
Thanks
[SOLVED] - CSS Padding
Moderator: General Moderators
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
[SOLVED] - CSS Padding
Last edited by iknownothing on Mon Mar 12, 2007 11:10 pm, edited 1 time in total.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
You might want to Google for "CSS box model" for more information about how margins and padding work. Here is a link with a picture that shows what is going on.
http://www.ilovejackdaniels.com/css/box-model/
http://www.ilovejackdaniels.com/css/box-model/
(#10850)
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US