This site is designed for accessibility. Content is obtainable and functional to any browser or Internet device. This site's full visual experience is available in a graphical browser that supports web standards. Please consider upgrading your web browser.
Given the following document markup, the following process determines the final set of declarations which apply the numbered element [3] below. Considering the specificity of selectors, possible inheritance, and the effects of inline styles, the final set of declarations which apply to [3] is at the very end of this document.
Declarations apply if the associated selector matches the element in question for the target media type. Reference: Example 3 document tree.
Rule# | Selector | Meaning | Does it match? | Is it inherited? |
---|---|---|---|---|
1 |
*[id~="pg-title"] |
This selects any element with an id attribute that contains the word pg-title. | no | no |
2 |
h1[id|="pg"] + * + div
|
This selects any div element that immediately follows any element that immediately follows a h1 element with an id attribute that equals pg or begins with pg-. | no | no |
3 | div | This selects selects any div element. | yes | no |
4 | li:first-child | This selects any li element that is a first child. | no | no |
5 | li | This selects any li element. | no | no |
6 | div[id] p | This selects any p element that is a descendant of a div element with an id attribute. | no | no |
7 | div#content | This selects any div element with an #ID that equals content. | no | no |
8 | *#content p | This selects any p element that is a descendant of any element with an #ID that equals content. | no | no |
Disregard the ones that don't match. This style remains:
Rule# | Selector | Meaning | Does it match? | Is it inherited? |
---|---|---|---|---|
3 | div | This selects selects any div element. | yes | no |
All the same weight and origin (author). No "!important" declarations, no imports.)
Examine and rate each selector.
This selects selects any div element.
Only one rule to consider.
Specificity | Rule# | Selector | color: | background: | font-weight: | font-style: | border: | padding: |
---|---|---|---|---|---|---|---|---|
0-0-1 | 3 | div | bold |
No rules confilct.
Specificity | Rule# | Selector | color: | background: | font-weight: | font-style: | border: | padding: |
---|---|---|---|---|---|---|---|---|
0-0-1 | 3 | div | bold | |||||
The winner | bold |
div {font-weight: bold;}