W3C validation with AngularJS directives

Strict w3c validation allows any data-* attributes, and any class. Directives can be applied to DOM elements with any of: <tag directive-name> <tag data-directive-name> (*) <tag x-directive-name> <tag directive_name> <tag x_directive_name> <tag data_directive_name> At least the data- one is fully W3C compliant (provided you declare HTML5 doctype). So the following code validates (the attribute name, … Read more

“& did not start a character reference. (& probably should have been escaped as &.)” w3c markup

Did you include the semi-colon after &amp? Your link should be <a href=”https://stackoverflow.com/questions/15970738/index.php?option=com_content&amp;view=article&amp;id=6&amp;Itemid=4″> Note that if you paste this url into the address bar of your browser it won’t work – the browser converts the &amp; into & when you click the link in the page.

How do I escape an ampersand in a javascript string so that the page will validate strict?

Try putting your javascript inside a CDATA block like this: <script type=”text/javascript”> <![CDATA[ // content of your Javascript goes here ]]> </script> which should make it pass validation. To be extra safe you can add Javascript comments around the CDATA tags to hide them from older browsers who don’t understand the CDATA tag: <script type=”text/javascript”> … Read more

How to resolve “No p element in scope but a p end tag seen” error in W3C Validation?

That’s because you are nesting a block level element inside the p tag which is invalid. You can only nest inline elements such as span, a and img inside p tag. So your markup is invalid, consider making something like <div class=”inr_content clearfix”> <div class=”col2 first fl”> <p>to provide a drive-in services.</p> </div> <div class=”col2 … Read more

‘div’ inside ‘table’

<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”> <head> <title>test</title> </head> <body> <table> <tr> <td> <div>content</div> </td> </tr> </table> </body> </html> This document was successfully checked as XHTML 1.0 Transitional!

tech