467,115 Members | 1,270 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,115 developers. It's quick & easy.

Spacing

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
  • viewed: 1754
Share:
3 Replies
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
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
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.

Similar topics

12 posts views Thread by Rick DeBay | last post: by
7 posts views Thread by Danny@Kendal | last post: by
5 posts views Thread by Andrew Poulos | last post: by
4 posts views Thread by fleemo17@comcast.net | last post: by
12 posts views Thread by Sebastien B. | last post: by
3 posts views Thread by DigMar | last post: by
10 posts views Thread by phil-news-nospam@ipal.net | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.