Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit a938697

Browse files
committed
Slightly clarify the note on attribute selectors
1 parent d69bdd0 commit a938697

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

css/css-best-practices/readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ ul.button-group li.button {
6464

6565
A common use case is to target input types. For example `input[type="text"]`.
6666

67-
It's important to realize that the element selector is not necessary here. If you think about it, we are actually increasing the specificity needlessly.
67+
It's important to realize that the element selector is not necessary here. If you think about it, we are actually increasing the specificity needlessly. Attribute selectors have the same specificity as a class. The above example has the same specificity as `input.someClass`
6868

69-
All we really need is `[type="text"]`
69+
All we really need is `[type="text"]`, because that is sufficient for targeting text inputs.
7070

71-
So for that reason, *attribute selectors should be used alone*, just like classes.
71+
In summary: *attribute selectors should be used alone*, just like classes.
7272

7373

7474
## Class Naming Convention

0 commit comments

Comments
 (0)