Should I Avoid Tags Unsupported in HTML5 If I Am Using XHTML 4.01 Strict?
-
20-09-2019 - |
Question
These elements are not supported in HTML 5 but are supported in XHTML:
acronym
big
tt
In the future, when I will change my doctype to html 5, then will I not need to replace or change any code to pass validation?
this is also accepted as valid code in an attempt to ease the pain for avid XHTML coders (like myself) who are used to self-closing elements:
<tag type="type" id="name"/>
The same rules apply to <meta>
and other self closing elements.
Is it a good idea to avoid HTML 5 unsupported tags, If I am using XHTML 1.0 Strict
now?
Solution
Yes, it would be a good idea to plan ahead for HTML5 support. Check here for a list of deprecated tags and attributes to avoid.
As far as XHTML syntax (always closing tags, self closing tags, etc) you can continue to use that without worry. HTML5 can be written using standard HTML syntax or XHTML syntax, though it always remains just HTML.