The #
symbol indicates that it’s an ID selector, so it will only apply to the single element that has that particular ID on the page. You’re incorrect about example A – that’s actually a selector for the element with the ID input
, not a general selector for all inputs.
The .
symbol indicates that it’s a class selector, so it will apply to all elements that have that class.
The [type="text"]
is an attribute selector, so it will only select input elements that have a type attribute with a value equal to text
.
1
solved Differences in these syntaxes for CSS? [closed]