CSS 2.1 errors: not a known property name

前端 未结 5 1532
逝去的感伤
逝去的感伤 2021-02-04 10:39

Here is my code, I got it from an AJAX sample:

body, div, p, h1, h2, h3, h4, ul, li, table
{
    margin:0;
    padding:0;
    border:none;
}

body
{
    backgrou         


        
相关标签:
5条回答
  • 2021-02-04 10:42

    You need to validate this as CSS3

    http://jigsaw.w3.org/css-validator/#validate_by_input+with_options

    When you do that, you will two errors for your opacity styles and a bunch of warnings dealing with duplicated background-colors.

    0 讨论(0)
  • 2021-02-04 10:48

    The errors you are getting are validation errors. Opacity and filter are not in the CSS 2.1 spec despite being supported by all major browsers.

    0 讨论(0)
  • 2021-02-04 10:50

    Validation errors are all fine, because they are using the proper CSS 2.1 Documentation and your trying to validate CSS3 properties in a CSS 2.1 context.

    What you probably want is to build your application bypassing the CSS Errors, no matter what they are, for that you can transform this "errors" into warnings using Visual Studio Options:

    in The Visual Studio menu click on:

    Tools > Options... and drill down Text Editor > CSS > Miscellaneous

    and just make the CSS Errors to be treated as warnings

    enter image description here

    2013 version

    enter image description here

    0 讨论(0)
  • 2021-02-04 11:02

    You're validating your stylesheets against CSS 2.1, but those properties are CSS3.

    Change your stylesheet validation to CSS3.

    0 讨论(0)
  • 2021-02-04 11:03

    I realize that this response is a little late, but someone else may find this information useful.

    To make the filter tag warning go away in VS2010 (as opposed to just ignoring it), close VS2010 and edit the following file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\1033\schemas\CSS\css30.xml

    You need to change the filter property from enum to composite.

    Around line 387, you should find the following text: <cssmd:property-def _locID="filter" _locAttrData="description,syntax" type="enum" ...

    Change it to: <cssmd:property-def _locID="filter" _locAttrData="description,syntax" type="composite" ...

    Then restart VS2010.

    0 讨论(0)
提交回复
热议问题