- Feb 14, 2004
- 50,754
- 6,782
- 136
I'm studying CSS right now and I was wondering if it is possible to create your own CSS elements. I know that you can create custom selectors for classes or IDs, but what about elements? Say I wanted to create an element called "kaido" and attach a class to it, like so:
kaido.header {h1; color: #ebebeb; text-decoration: underline}
Then I would use that in the HTML file like this:
<kaido class="header">This is the title of the article</kaido>
Is that possible? Or is CSS locked into existing HTML/XHTML elements?
Edit: I should re-phrase my question: is it *legal* and valid to create custom elements? I know that it works, but I'm striving for 100% validation...
kaido.header {h1; color: #ebebeb; text-decoration: underline}
Then I would use that in the HTML file like this:
<kaido class="header">This is the title of the article</kaido>
Is that possible? Or is CSS locked into existing HTML/XHTML elements?
Edit: I should re-phrase my question: is it *legal* and valid to create custom elements? I know that it works, but I'm striving for 100% validation...