Question about using <br /> with 'strict' xhmtl

B

BT

I've just started the move from html to xhtml and I have a question. I was
getting verification errors from all of the <br /> tags that I added to a
page. I thought this tag could be used anywhere. By trial and error, it
seems that this tag works just fine...as long as it is inside of <p> or
<div> tags.

Can anyone give me some more detail or point me to a link where I might find
out how and where this tag can be used with 'strict' xhtml?

much appreciated
 
B

Barbara de Zoete

[ using said:
Can anyone give me some more detail or point me to a link where I might
find
out how and where this tag can be used with 'strict' xhtml?

The DTD tells:
<http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>


--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
D

David Dorward

BT said:
I've just started the move from html to xhtml and I have a question. I
was getting verification errors from all of the <br /> tags that I added
to a page. I thought this tag could be used anywhere.

They can go pretty much anywhere you can have text (character data) or
images. Since you haven't mentioned problems with text or images it
suggests that you are misusing them as a substitute for the CSS margin
properties.
 
S

Steve Pugh

BT said:
I've just started the move from html to xhtml and I have a question.

And apparantly from Transitional to Strict at the same time. You'll
probably gain greater benefit from going to HTML 4 Transitional to
HTML 4 Strict than you will in any change from HTML to XHTML. But so
long as you understand what using Strict means and write your code
accordingly the difference between HTML 4.01 and XHTML 1.0 is largely
irrelevant.
I was
getting verification errors from all of the <br /> tags that I added to a
page. I thought this tag could be used anywhere. By trial and error, it
seems that this tag works just fine...as long as it is inside of <p> or
<div> tags.

In the Strict versions of HTML 4.x and XHTML 1.0 text (and HTML markup
Can anyone give me some more detail or point me to a link where I might find
out how and where this tag can be used with 'strict' xhtml?

Structure your code so that all text (and hence all line breaks - you
are using <br> to break lines of text and not create the illusion of
vertical margins, aren't you?) is marked up inside an appropriate
block level container.

Steve
 
J

Jan Faerber

BT ... output:
I was
getting verification errors from all of the <br /> tags that I added to a
page.

With Quanta you get those errors aswell. The verification depends on the
tool you use. Quanta does not verify xhtml and does not know <br />.
You will get an error:

'[line number]: unknown attribute "/" for element <br>.'

http://validator.w3.org/ ... but this validator knows it better - e.g.:

http://tinyurl.com/5cmbb says:

This page is not Valid XHTML 1.0 Strict!

Line 16, column 976: end tag for "br" omitted, but OMITTAG NO was specified

....256" size="55" name="q" value=""><br><input type="submit"
value="Google-Suche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top