html - Are property values in CSS case-sensitive? -


i have observed css properties, font-family declared quotation marks, perhaps case-sensitive, other not... how web-browsers , "html renderers" must interpret? same in css context (xml, svg, etc.) , other applications? what standards about?

example: adobe indesign exported both, font-family:'optima bold' , font-family:'optima bold'. can "normalize lower case" (ex. merge similar classes)?

notes

references incomplete , in conflict:


comparing this question/answers, the point here, perhaps, can translated (personal) objective considerations:

  1. there (objective!) normative (w3c spec of css2, css3, xhtml1, or html5) source answer?

  2. "standard font-family unique names" can not case-sensitive (otherwise cease standard)... so, justifiable (by sensible arguments) properties case-sensitive are:

    2.1. x values @ url(x), see background, etc. properties;

    2.2. content values, example;

    2.3. ... more ?? ...

(updating @Álvarog.vicario answer , comments, , complementing answer... wiki, please edit enhance)

example: css3 (and html5) there new explicit rules, "font-face property must case-insensitive".[2]


context

w3c interoperating standards, xml, html, csv , css.

css general rules

css2 (a w3c standard of 2008) fixed basic conventions "characters , case", , css3 (a w3c standard 2015) added more.

  1. by default "all css syntax case-insensitive (...)" [1]

  2. there exceptions, "(...) except parts not under control of css"[1]

    2.1. element names case-sensitive in html5 (?) , xml, case-insensitive in html4.

    2.2. identifiers (including element names, classes, , ids in selectors) case-sensitive. html attributes id , class, of font names, , of uris lies outside scope of css specification.

  3. ....

  4. the

case matrix

exceptions , specific (explicited in reference) rules. "yes" indicate value is case-sensitive.

property values:

  css property      | case-sens. | reference , notes  ------------------|------------|--------------------  %colorvals        | no         | [3]  font-family       | no         | [2]  %url              | yes        | ...  content           | yes        | ...  ----------------------------------------------------  %colorvals = color, background, etc.  %url = background-image, etc. use `url()`  

selector values:

  css selector      | case-sens. | reference , notes  ------------------|------------|--------------------  id                | yes        |...  element           | yes/no     | ... yes xml...  class name        | yes        | [5]  (`~ i` operator)  | no         | [6]  ----------------------------------------------------  yes/no = depends on document language (see ref. , notes). 

references:

[1] w3c/css2/syndata, sec. 4.1.3 characters , case.

[2] w3c/css3-fonts, sec. 5.1 case sensitivity of font family names

[3] w3c/css3-color, sec. 4.1. basic color keywords

[4] w3c/css3-values, sec. 3.1. pre-defined keywords

[5] w3c/selectors, sec. 3. case sensitivity

[6] w3c/selectors4, sec. 6.3. case-sensitivity


quotations , notes

user agents must match these names case insensitively. [2]

.

...


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -