0

I would like to know if this code is allowed?

<article intro> .... </article>

I would like to use this if this is valid as attribute/elements of HTML5. If possible, i wanted to use this to simplify my HTML / CSS connection. Instead of using class="intro" will use [intro].

iMarkDesigns
  • 1,200
  • 2
  • 14
  • 32
  • 1
    We have [validator.w3.org/](http://validator.w3.org/) – Mr. Alien Aug 24 '13 at 07:52
  • Yes sir, however i saw one time a site that uses this kind of element. But after i check it to validator. "Attribute **intro** not allowed on element **article** at this point". – iMarkDesigns Aug 24 '13 at 07:57
  • Ok thank you Mr. Alien got your point. Btw, this custom attributes makes me confused. Let say, instead of using `class="intro"` for my CSS, I'll use `intro` to make it look like **[intro]** than to this **.intro**. But referring to my comment, it is not valid as it is for HTML5. As @nisarg statement [link](http://stackoverflow.com/a/17700529/852916) _"Custom tags are not valid in HTML5. But currently browsers are supporting to parse them and also you can use them using css."_ Thank You for your time. – iMarkDesigns Aug 24 '13 at 08:23
  • Wait wait, what you are trying here, where did `class` came here? – Mr. Alien Aug 24 '13 at 08:25
  • Aside from the HTML, i would like also to apply it to my CSS to simplify the attributes/elements styling. Well, i guess i will stick to the legit attributes than to this. – iMarkDesigns Aug 24 '13 at 08:29
  • 1
    Nah, don't do that, instead follow the default approach, the way you are doing is wrong – Mr. Alien Aug 24 '13 at 08:33
  • Yes I will not do that. Thank you for your time, I appreciate it. :) – iMarkDesigns Aug 24 '13 at 08:35

1 Answers1

1

Use following validating tool for HTML 5 :

http://html5.validator.nu/

http://validator.w3.org/

Use this code :

<article data-intro> .... </article>
Divya Bhaloidiya
  • 5,018
  • 2
  • 25
  • 45