From: shapper on
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
From: Jonathan N. Little on
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
From: Beauregard T. Shagnasty on
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
From: shapper on
On Jan 11, 2:28 am, "Jonathan N. Little" <lws4...(a)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