문제

I am checking code on w3c validator and I keep getting these errors for each individual blog and portfolio post that has the "Like" button attached to it. Is there something I can do to correct these errors so they validate properly?

Here is a sample of the code:

<a href="#" class="like " title="Like this" data_action="likepost" data_postid="74" data_nonce="13e20f93ee">
    <span class="glyphicon glyphicon-heart"></span>
    <span class="likecount">2</span>
</a>
도움이 되었습니까?

해결책

Make sure you have doctype declaration like:

<!DOCTYPE html>

and replace the custom attributes as :

data-action data-postid and so on.

Note the hyphen instead of underscore. HTML5 allows custom attributes and suggests to use those which starts with data- .

A custom data attribute is an attribute in no namespace whose name starts with the string data-, has at least one character after the hyphen, is XML-compatible, and contains no uppercase ASCII letters

Reference

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