I have various html tags (related to jquery mobile) that Visual Studio is flagging as not valid attributes: For exmaple:
<div data-role="page" id="my_id" data-theme="b" data-position="fixed">
Gets amongst others:
Validation (XHTML 1.0 Transitional): Attribute 'data-role' is not a valid attribute of element 'div'
As you know, data-* are valid attributes of div in HTML 5.
I'm not sure how this is validated, though I think via DTDs and xmlns, so the head of the page is the default auto generated by Visual Studio:
<!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">
I know they are only warnings, but my experience is that if you leave lots of warnings that are invalid, then all the warnings that are valid get lost in the middle.
Is there any way to tell Visual Studio that these warnings should not be shown without completely disabling html validation?
(Visual Studio 2010 if it is relevant.)
The conclusion is that with Visual Studio today, you can build HTML5 and CSS3 web applications on top of ASP.NET, and with SP1 we are making it a lot easier for you.
You should install the Web Standards Update and then switch to HTML5 as your default schema:
In addition, you should not use the XHTML 1.0 transitional opening incantation when using HTML 5 attributes. Instead, use the usual HTML5 one:
<!DOCTYPE html> <html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With