Creating your own tags

They have: 27 posts

Joined: Sep 2005

I'm just wondering if it is possible to make your own tags (like ), and use CSS to make them useful. It seems to work on Safari, as far as I know.

I'm talking about some code like this:

mytag {color: red}

...

AARGH!!!
...

Will the "AARGH!!!" be red? (and will w3c kill me?)

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Well this is a good article to read:
http://www.alistapart.com/articles/customdtds2

Basically it should work, it's always good to have an understanding of how to write your own DTD though. Personally I've always stuck to the tags available in the standard DOCTYPES as those are the ones browsers support and know what to do with.

You should only need to write new tags in very specific circumstances and be aware that browsers may not support them properly.

Also check out who wrote that article (there's an earlier one you may want to read in there as well): The W3C QA Group. So they wont kill you, or steal your washing, but they want to be clear on the circumstances in which you should start creating your own tags.

Happy reading and come back if you have any questions Wink

a Padded Cell our articles site!

They have: 5,633 posts

Joined: Jan 1970

Good question technostick.
I think my next leap will be into DTDs

They have: 27 posts

Joined: Sep 2005

Thanks!

I just thought that it was quite a pain to type instead of just .

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.