Difference between a quoted and incorrect attribute selector in CSS

I was interested to know what is the difference between quoted and unspecified attributes in css selectors and whether this affects performance.

input[type="text"]

/

input[type=text]

Thanks in advance

+4
source share
1 answer

The above are the same. Quotation marks are optional for identifiers , but should be used when it is a string .

Some common string examples include:

  • Contains a space ( )
  • Starting at ( 0-9)
  • Contains a hyphen after a digit

Here is the complete identifier specification :

CSS ( , ) [a-zA-Z0-9] ISO 10646 U + 00A0 , (-) (_); , , . ISO 10646 (. ). , "B & W?" "B\& W \?" "B\26 W\3F".


: http://www.w3.org/TR/css3-selectors/#attribute-selectors

+6

All Articles