By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,199 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

Spacing

P: n/a
Hello,

I have a form with various labels, inputs and spans for comments.
Each element is in a different line.

I want to create some spacing between each element. For example, if I
have:

Name:
[Name Input]
Profession:
[Profession Input]
Profession Comment (Span)

So I want to create a 2px spacing between each line.

Should I use margin or padding? I know both work but what is the best
solution?
And are there other alternatives?

Thanks,
Miguel
Jan 11 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
shapper wrote:
Hello,

I have a form with various labels, inputs and spans for comments.
Each element is in a different line.

I want to create some spacing between each element. For example, if I
have:

Name:
[Name Input]
Profession:
[Profession Input]
Profession Comment (Span)

So I want to create a 2px spacing between each line.

Should I use margin or padding? I know both work but what is the best
solution?
And are there other alternatives?
http://www.w3.org/TR/CSS21/box.html#box-dimensions

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jan 11 '08 #2

P: n/a
shapper wrote:
So I want to create a 2px spacing between each line.
2px? That is very tiny. Perhaps even much tinier on your monitor .. or
on my monitor .. and will look almost "shoved against" what is above and
below.

Without even seeing your page, I'd suggest the bare minimum of 1em.

input { margin: 1em; }

--
-bts
-Friends don't let friends drive Vista
Jan 11 '08 #3

P: n/a
On Jan 11, 2:28 am, "Jonathan N. Little" <lws4...@centralva.net>
wrote:
shapper wrote:
Hello,
I have a form with various labels, inputs and spans for comments.
Each element is in a different line.
I want to create some spacing between each element. For example, if I
have:
Name:
[Name Input]
Profession:
[Profession Input]
Profession Comment (Span)
So I want to create a 2px spacing between each line.
Should I use margin or padding? I know both work but what is the best
solution?
And are there other alternatives?

http://www.w3.org/TR/CSS21/box.html#box-dimensions

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com
Hi,

Thanks for the link. I know the box model.
But if I can do it in both ways should i use margin or padding?
I suppose, since it is the spacing between 2 elements that I should
use margin.

Thanks,
Miguel
Jan 11 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.