Jump to content
Killersites Community
Graeme

Html 5

Recommended Posts

hello all,

in html 5 do you close tags say like this < /br> or

</br> no space before the /

i keep getting errors when validating and they all seem to be badrd around this

thank you as always

best wishes

graeme

Share this post


Link to post
Share on other sites

You're getting errors because that's not the right form. A valid break tag looks like this:

 

<br>

<br />

 

As far as I can tell, when using HTML5, "<br>" is the right way to do it.

  • Upvote 1

Share this post


Link to post
Share on other sites

Same as in HTML 4 - </p> (but some closing tags are no longer required) If but if you really want to know all about it, read this

Share this post


Link to post
Share on other sites

I have used <br> without problems.

 

<br> is the correct way for HTML 4 and 5.

 

XHTML requires <br/> (the space is for older browsers, but I don't know what the exact definition of 'older' is)

 

HTML 5 does not need the closing tags that XHTML requires, however, using them will not give you any validation errors.

Share this post


Link to post
Share on other sites

thanks andrea,

the link you gave me is amazing, now i'm baffled about the tables, no <tr>!

I think you might be confused about that. Can you point to the spot in the article where it says it has been depreciated?

Share this post


Link to post
Share on other sites

I think you might be confused about that. Can you point to the spot in the article where it says it has been depreciated?

 

Maybe this part - it does read like that to me, too:

 

 

8.1.2.5 Restrictions on content models

For historical reasons, certain elements have extra restrictions beyond even the restrictions given by their content model.

 

A table element must not contain tr elements, even though these elements are technically allowed inside table elements according to the content models described in this specification. (If a tr element is put inside a table in the markup, it will in fact imply a tbody start tag before it.)

 

 

 

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×