I...">

XHTML - adding new elements

How to add new tags to an xhtml document without making the markup "invalid"?

eg:

instead <span class="time">I would like to use <time>. Is it possible? because I saw that the facebook application is doing something like this.

+3
source share
1 answer

You need to declare a new namespace for your invented elements:

<html xmlns:foo="urn:my-namespace">
...
<foo:time>...</foo:time>

or

<html>
...
<time xmlns="urn:my-namespace">...</time>

Of course, this will not make a catch in your browser, but I suppose you have good reasons to want to.

+1
source

Source: https://habr.com/ru/post/1753422/


All Articles