문제

I saw this on a CMS(sitecore) based Asp.net 2.0 Webform based site.

<a class="boardTextLink " id="boardTextLink6" headerindex="5h">

is it semantically correct and w3c valid? Can we make and use custom attributes like this? Is it good practice?

도움이 되었습니까?

해결책

no it's not correct and not a good practice. This kind of markup would fail to validate

This argument was used against dojo toolkit, the JavaScript framework heavily use custom attributes for doing some automatic replacement to create widget.

more reading about the custom attribute VS class here.

I think it's kind of okay to use that for private website (CMS admin interface closed website intranet) but you should avoid it on public websites.

다른 팁

its a private made-up attribute probably placed there to be examined/used by some javascript

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top