Skip to content

Commit

Permalink
Updated index.md as suggested on the issue#25890 (#26100)
Browse files Browse the repository at this point in the history
* Updated index.md as suggested on the issue#25890 

I have updated line: 55 from`If the password input type is nested in an element with id="myApp" set, the specificity weight will be 1-2-1.` to `If the password input type with required is nested in an element with `id="myApp"` set, the specificity weight will be `1-2-1``

* Update files/en-us/web/css/specificity/index.md

Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>

* Update files/en-us/web/css/specificity/index.md

---------

Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
  • Loading branch information
w3tsa and estelle authored Apr 13, 2023
1 parent fc11c08 commit 1e77aa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/en-us/web/css/specificity/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ All inputs, no matter the type, when receiving focus, match the second selector

The specificity for a required input nested in an element with attribute `id="myApp"` is `1-2-1`, based on one ID, two pseudo-classes, and one element type.

If the password input type is nested in an element with `id="myApp"` set, the specificity weight will be `1-2-1`, whether or not it has focus. Why is the specificity weight `1-2-1` rather than `0-1-1` or `0-1-0` in this case? Because the specificity weight comes from the matching selector with the greatest specificity weight. The weight is determined by comparing the values in the three columns, from left to right.
If the password input type with `required` is nested in an element with `id="myApp"` set, the specificity weight will be `1-2-1`, based on one ID, two pseudo-classes, and one element type, whether or not it has focus. Why is the specificity weight `1-2-1` rather than `0-1-1` or `0-1-0` in this case? Because the specificity weight comes from the matching selector with the greatest specificity weight. The weight is determined by comparing the values in the three columns, from left to right.

```css
[type="password"] /* 0-1-0 */
Expand Down

0 comments on commit 1e77aa6

Please sign in to comment.