0

I am trying to define my own HTML attributes not for styling purposes but mainly because they will actually get functions described in javascript. Now I know HTML5 comes with the data- attributes but I personally like the thought of my own HTML tag.

Browsing through the internet I found XMLNS is the way to go, however, I can not find how you can style those elements.

Can someone please shine some light on the matter?

http://jsfiddle.net/KaJT8/

pnuts
  • 58,317
  • 11
  • 87
  • 139
Mark
  • 16,906
  • 20
  • 84
  • 117

1 Answers1

1

If your element is called ui:tabbar, you'll need to use a selector like:

ui\:tabbar {

}

in your CSS. You'll need to test this in older versions of IE, as I believe they'll need a bit more coercing.

Though you likely know it, this isn't really what you are 'meant' to do, and you'll find many people think you are a complete nutter for suggesting it :)

Rich Bradshaw
  • 71,795
  • 44
  • 182
  • 241
  • Is that so? How come? Facebook used to do it with FXML – Mark May 13 '12 at 16:00
  • To be completely fair, I find ui:tabbar makes much more sence then div class="tabbar" – Mark May 13 '12 at 16:01
  • 1
    Tested (and worked) in IE6, 7, 8, 9. Firefox 3. Chrome 18. Safari 5.1. – Mark May 13 '12 at 16:06
  • It won't validate, for obvious reasons. That's cool that it worked in IE6/7, thought it might break there. Did you add your own XMLNS stuff as well? Facebook did it until everyone complained, so they moved to data- attributes. – Rich Bradshaw May 13 '12 at 16:21