1

I understand that you can make your own HTML tags, but how do I go about doing it?

Can you make it once and then just use it over and over again in the same file without redefining it? Can you import it into other files?

I also want to know if it is recommended to make custom HTML tags. Does it work in all browsers?

I know this is a lot, so I will thank you in advance.

3

1 Answer 1

2

Why would you want to do that in the first place? Generally, people stick with existing tags and if they need to make them unique, they do it through ids, classes or attributes. However, with introduction of HTML5, which introduced a number of new tags, this problem surfaced, since IE was not supporting them. The solution for supporting HTML5 tags in IE was using HTML5 shiv. Basically, in the head you do something like that:

document.createElement("article");  
document.createElement("footer");  
document.createElement("header");  
document.createElement("hgroup");  
document.createElement("nav"); 

Perhaps you can do something like that? Still not sure why you'd want to do that though.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.