On 5/19/07, Francesco Rizzi <[EMAIL PROTECTED]> wrote:
> Consider an hypothetical situation:
> the project requirements call for some vertical space between a certain
> element on your web page (picture an horizontal line, like an hr), and a
> second element (picture a textbox).
>
> There's many ways you can achieve this effect. My instinct would be to give
> the second element some css style.. a margin-top, or a padding-top,
> depending on the situation.
> An hypothetical colleague, however, suggests simply placing a <br> tag
> between the two.
> Actually, since the hypothetical requirements call for some added vertical
> space right after that textbox, the colleague suggests:
> <hr><br>[textbox]<br><br>
>
> Yes, yes, <br> instead of <br />. It's hypothetical, don't worry about that
> detail.
>
> So, my question for the list is:
> why should we use css rules in this scenario instead of <br> tags ?
>
> Thank you in advance,
> F.
> ______________________________________________________________________
> css-discuss [EMAIL PROTECTED]
> http://www.css-discuss.org/mailman/listinfo/css-d
> IE7 information -- http://css-discuss.incutio.com/?page=IE7
> List wiki/FAQ -- http://css-discuss.incutio.com/
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>

You're hardcoding space that will be interpreted very differently by
different browsers where you could take advantage of css.

I think there are some very real arguments for using linebreaks in
copy that needs to break at just the right spot (so says the
copywriter), but I can't imagine a situation in which you wouldn't be
better served by styles than a <br /> for layout.

In this instance, your hypothetical friend may find that <br> gives
you some vertical space, but there's no specifying (in your example)
how much space.  With styles, you could determine that down to the
pixel and make it consistent across browsers.
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to