Solved

W3C Validation Issue with data-pin-hover="true" and nopin="nopin"

Posted on 2013-10-25
3
723 Views
Last Modified: 2013-10-25
How can this be made to pass W3C's standards and validate correctly?

I cannot change the document type definition and the non-standard attributes are required.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Demo</title>
</head>
<body>

<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Pileated_Woodpecker!_mirrored_flying-pattern.svg/600px-Pileated_Woodpecker!_mirrored_flying-pattern.svg.png" alt="" nopin="nopin"/>
<br />
<img src="http://upload.wikimedia.org/wikipedia/commons/6/66/Fulvous-breasted_Woodpecker_(Dendrocopos_macei)_at_Kolkata_I_IMG_3848.jpg" alt="" />

<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js" data-pin-hover="true"></script>

</body>
</html>

Open in new window

0
Comment
Question by:hankknight
  • 2
3 Comments
 
LVL 58

Assisted Solution

by:Gary
Gary earned 250 total points
Comment Utility
data-* is an HTML5 custom attribute, it is not valid in any other versions of HTML/XHTML as you are using so just change your doctype to
<!DOCTYPE html>
0
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 250 total points
Comment Utility
You've kind of answered your own question:

How can this pass standards when using non-standard attributes!

Simple answer is - it can't. If you need non-standard attributes, then accept that it will fail standards validation
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Don't understand why you cannot change the doctype.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now