View Full Version : [css] Use 'padding' or 'margin'?
Grover
Thu 8th Apr '04, 4:50am
Hi,
I found that there's not enough whitespace around a message in my postbit. See screenshot. I have a simple question.
By using CSS I can add some whitespace around it. I would like to know what is adviceable to do?
Use the 'padding'-setting or use the 'margin'-setting? I am in the process of learning CSS, so I was wondering when you use padding and when margin actually.
achtungbaby
Sun 11th Apr '04, 5:55am
Hi,
I found that there's not enough whitespace around a message in my postbit. See screenshot. I have a simple question.
By using CSS I can add some whitespace around it. I would like to know what is adviceable to do?
Use the 'padding'-setting or use the 'margin'-setting? I am in the process of learning CSS, so I was wondering when you use padding and when margin actually.
Here ya go... (http://www.brainjar.com/css/positioning/default.asp)
It's got pictures and everything:)
Grover
Tue 13th Apr '04, 3:39am
Here ya go... (http://www.brainjar.com/css/positioning/default.asp)
It's got pictures and everything:) Thanks, but I could not find the answer to my question in that article.
Icheb
Wed 14th Apr '04, 11:33am
"margin" defines how much space is between elements. Say you have two images and insert a margin of 5px in each img-tag, then both images will be 10px apart.
"padding" defines the distance between the border of an element and its content. Say you have a div-tag with some text in it, you have a border color assigned to the div (you don't need to set a border color, I just use this as an example so you can visualize it better) and you have set padding to 5px. Then the distance between the border and the text will be 5px.
Grover
Wed 14th Apr '04, 11:38am
"margin" defines how much space is between elements. Say you have two images and insert a margin of 5px in each img-tag, then both images will be 10px apart.
"padding" defines the distance between the border of an element and its content. Say you have a div-tag with some text in it, you have a border color assigned to the div (you don't need to set a border color, I just use this as an example so you can visualize it better) and you have set padding to 5px. Then the distance between the border and the text will be 5px. Thanx for explaining : I already knew this theory. But it's nice to get an refreshment :)
Anyway, it doens't really answer my initial question. Do I use padding or margin on the example above or doesn't really matter, as long as I get the same results?
Icheb
Wed 14th Apr '04, 11:43am
My explanation was in response to
I am in the process of learning CSS, so I was wondering when you use padding and when margin actually.
You should just try both settings separately and see what you like best. However, I'd say use padding.
kyk0
Thu 15th Apr '04, 2:14am
Padding.
Also what is your $stylevar[cellpadding] var set to? If you look in the postbit_legacy template you could edit it manually.
Grover
Thu 15th Apr '04, 6:35am
Alright! Thanks for the replies... I will use padding then. I've got a new example (see screenshot) to show you that it's really a good thing to enlarge the padding/margin. Look how the 7-sized letter 'j' is pushed against the left light-blue border.
Powered by vBulletin™ Version 4.0.0 Beta 4 Copyright © 2009 vBulletin Solutions, Inc. All rights