I want to switch CSS validation in VS2010 SP1 from CSS 2.1 to CSS 3.
I came across this answer:
Is it possible to change CSS Validation scheme in VS2010
What is not clear to me is how to activate CSS 3 validation. I did find that switching HTML validation to HTML 5 causes CSS to be validated as CSS 3 (after installing CSS 3 Intellisense Schema).
However, I would have thought that the HTML level and the CSS level would be orthogonal.
Am I missing something, or does the HTML validation switch truly also control the CSS validation level?
First, right click on the toolbar in VS2010 and enable 'Style Sheet'. Then once a CSS file is open and has focus you can change the target CSS validator from the drop down.
Related
I'll love if you can help me with a problem.
I'm developing a task app (just to practice) and I started with the styles using SASS.
Just to validate that the SASS is running I added a body background color, but this style does not applying for all views.
When I saw the console to see the html structure, I noticed that some views doesn't have the html structure from the application.html.erb, just the html that I have in that file.
NOTE: I have the style applied in a main.scss file, where all the files should have the style.
This is the root route
This is another view, where the style is applied
EDIT: I found the next message when inspect the element, but I don't know why is this happening
In my CKEditor instance, I am seeing formatting styles added that start with div. (i.e. div.dataTables_xyz, div.dt-button-xyz, div.dtr-modal-xyz.) How can I find out which plugin is adding them? (or if it's core ckeditor, how can I remove them?)
Tried removing several plugins that I thought might be the culprit (i.e. Div Editing Area, Div Container Manager)
I would prefer not to have those styles listed, as they are numerous and will likely confuse our users.
the plugin was stylesheet parser.
https://ckeditor.com/cke4/addon/stylesheetparser
I have been getting all of these "Validation (): Element 'x' is not supported" warnings and I can't seem to find a way to get rid of them. Here are two examples:
Validation (XHTML 1.0 Transitional): Attribute 'name' is not a valid attribute of element 'ul'.
Validation (CSS 2.1): 'border-radius' is not a known CSS property name.
I have searched on the web and all solutions point to removing the following folder:
C:\Users\{username}\AppData\Roaming \Microsoft\VisualStudio\10.0\ReflectedSchemas
Which seems to fix 90% of people's issues, however I don't have that folder anywhere on my computer!
I am using Visual Studio 10 SP1 and this project is an MVC 3 project using Razor and HTML5.
So can anyone else suggest what else might be causing the issue?
Thanks very much.
I was encountering the same problem and ALL classic html elements (div, a, p, table..) in every page had green underlines. Intellisense did not give any help with these elements, as if they didn't exist. But all asp controls were fine and valid.
The error was the xmlns="https://www.w3.org/1999/xhtml" in the html tag in my master page. Html 5 does not seem to work well together with the xmlns declaration so I removed it, and voila - everything magically works again!
Those are valid warnings, not a bug or other sort of "issue." The list of valid attributes for <ul> is given in the W3C standards, and it doesn't include name. Meanwhile, border-radius was introduced in CSS 3, which means if you validate against CSS 2.1 it's not going to work.
You can either ignore them or figure out how to suppress those particular warnings in VS2010 (I know how to do that for VC++, but I haven't used VS for HTML before; there should be some section in the Properties window for it).
First of all you need to know it's not an error!
Steps to resolve the warning message for an element.
Right click the warning area, you will see a context menu.
Click "Formatting and Validation..." basically it's at the bottom of the menu.
Go to "Validation" in "HTML or HTML (Web Forms)" section. You'll see a checkbox with "Show errors" is checked to true with header "Options". Just unchecke it.
enter image description here
enter image description here
That's it, you are done...
You have to remove
xmlns="https://www.w3.org/1999/xhtml"
let it remain
<!DocType Html>
only above
I validate CSS in my new projects against CSS 3.0, thanks to the solution here:
VS2010, HTML 5 and CSS 3 Validation
However, every time I load the project, CSS validation reverts to 2.1 and has to be set through the toolbar to validate against 3.0 again.
Is there a way to make my selection sticky?
You can set it in Options -> Text Editor -> CSS Validation. I have taken the screenshot from VS2012. It is same in VS2010.
First, shut down VS2010
Assuming you're validating against html5 - the validation option is in
Text Editor-->HTML-->Validation
Set it to HTML5 validation. Then verify the following file exists:
< your install directory >\Microsoft Visual Studio
10.0\Common7\Packages\schemas\html\html_5.xsd
Copy the file elsewhere to be safe then edit the original file using a text editor. Near the top of the file find the string:
vs:cssschema="CSS 2.1"
and change it to:
vs:cssschema="CSS 3.0"
if it isn't already. Then save the file and restart VS2010. That should take care of making CSS 3.0 validation sticky against html5 projects
In reference to these related questions, I have had CSS3 validation set up in VS2010 for a while.
However each time I close a CSS file, the "cascading style sheet version for validation" dropdown in the css toolstrip changes back from CSS 3.0 to CSS 2.1. When reopening a css file, I need to reselect CSS 3.0 to avoid the validation errors.
Is there any way to change the default? Even a registry hack would be acceptable at this point, it really is quite annoying.
There is another benefit of changing the default for this, when editing a cshtml file. Without a CSS file open, the validation target dropdown is grayed out. So to change it to 3.0 you have to have a CSS file open. Another annoyance.
I checked Tools > Options > Text Editor > CSS, but there is no validation tab like there is for HTML.
Option 2 is to go into C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\1033\schemas\CSS and rename css30.xml to css21.xml (backup your files first of course).
That way, even though VS will show it is validating for version 2.1 it will really be validating for version 3.0