Is it right to create my HTML tags?

Asked

Viewed 1,595 times

7

I’m creating a website and I don’t really like adding classes and id’s because I think it makes HTML a little dirty.

The system I am developing will not be indexed by the search engines, because it is a small web app that contains a private page where requires login. So I guess there’s no need to use the tags HTML5.

An example.

This is certain or there may be problems of incompatibility?

  • If you want to create custom tags, pq does not part pro XML ?

1 answer

5


First of all, you need to know that you’re not creating tag HTML. HTML is just what was defined by W3C with this nomenclature. HTML is a default that does not allow customization. You are creating tags XML that browsers accept joint use by liberality of interpretation allowing it to interact with the DOM in whatever it needs.

It could even be a public site if you need indexing, just know that some browsers may not understand this well (it can’t be very old, like IE8).

You need to know how to do it right. By example it seems you know, except for the names used.

It may suffer a little with most of the development aid tools that will complain of "their" tags. This is an incompatibility (because of them, not your).

Maybe in the future a tag HTML pattern that uses the same name as used. You will have to make a global renaming from yours to something else. ls that okay with you? To avoid this it is recommended that the name of your customized always have a dash (minus sign) in the name.

Within those conditions everything is ok. Go deep!

Documentation. Draft of technology. JS useful.

Interesting tutorial on the subject.

  • 1

    It is not semantic, so impractical to let each one is creating tag left and right, we talked a little about nomenclature pattern, if I wanted to use the same pattern in HTML we would have <titulo> instead of <h1> that is already indicated for this, for example, <sub_titulo>,<texto>,<texto_data>,<texto_autor> that it could be a basic tag that already exists and would receive a class to be treated differently. It makes it difficult to understand the next, if it distances itself from the standards and sincerely the W3C should stand up with it.

  • 4

    That’s why they made sure they never create tags with traces in the name and created the mechanism to be used when the person knows what is doing. To be, rightly, more semantic. Can anyone abuse this? Can. How can anything. It is good to explain to the Angularjs people that they did wrong.

  • As @bigown said, I was in doubt about Angular JS. I see some tags that are not HTML.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.