W3C home > Mailing lists > Public > www-validator@w3.org > September 2004

Re: <br> and top-margin

From: David Dorward <david@dorward.me.uk>
Date: Thu, 30 Sep 2004 13:35:59 +0100
To: Deon Meyer <dmeyer@centricity.co.za>
Cc: www-validator@w3.org
Message-ID: <20040930123559.GA21149@us-lot.org>

On Thu, Sep 30, 2004 at 02:28:40PM +0200, Deon Meyer wrote:
> How should I use the <br> tag in xhtml.
> I get errors if I only use <br>. If I change it to <br/> then the errors are
> gone. Is <br/> a legal tag or attribute.

Yes, and no.

In XHTML empty elements with no end tag must end the start tag with "/>"

http://w3.org/TR/xhtml1/#h-4.6

However, the format you use violates the HTML compatability guidelines:

http://w3.org/TR/xhtml1/#C_2
 
> Where should I put the top-margin="0".

Nowhere. You should use CSS for presentational detail like that.

-- 
David Dorward                                      http://dorward.me.uk
Received on Thursday, 30 September 2004 12:36:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:15 GMT