PDA

View Full Version : Empty tags



oldcrazylegs
Oct 30th, 2009, 05:31 AM
In HTML 5 do empty tags like <link> have to be terminated like <link /> in XHTML or as <link> in HTML 4?

SystemJay
Oct 30th, 2009, 01:48 PM
Straight aswer to your example I belive: <link />
http://www.w3schools.com/html5/tag_link.asp

To any other tag related question:
http://www.w3schools.com/html5/html5_reference.asp

Scriptet
Oct 30th, 2009, 02:42 PM
From what I remember they don't have to be, they just allow for it due to the widespread use of XHTML, and allow for the ease of migrating from this DOCTYPE.

VIPStephan
Oct 30th, 2009, 03:48 PM
HTML 5 can be written with classic HTML syntax or with XHTML syntax, depending on how you send it (as text/html or as application/xml+xhtml). Mind that if you send it as XML you also need to provide the proper namespace.

http://www.w3.org/TR/2008/WD-html5-diff-20080122/#syntax

oldcrazylegs
Nov 1st, 2009, 11:18 AM
Straight aswer to your example I belive: <link />
http://www.w3schools.com/html5/tag_link.asp

I saw that but wasn't sure if it was the correct way. It seemed strange mixing HTML with XHTML. Thanks.