I understand that there are 3 types of stylesheets:
- Default stylesheet defined by the user
If any Even in this stylesheet, an element has not been matched by any selector, only after that Credit value will be derived from the original elements. However, the book also states that the browser's default stylesheet should define a style for all types of elements.
If a browser's stylesheet defines a style for all types of elements, and in this style there is more space than heritage, then inherited property values should never be seen. Obviously this is not the case, what exactly are the correct priority rules for definitions defined for the properties and parental elements in the browser's default stylesheet? (I know that not all CSS properties have been inherited, but for this discussion, assume that I am referring to a property such as color
)
thanks The browser does not define a style for all elements; don
a {color: blue; Border Bottom: 1px solid blue} p {margin-bottom: 1em; } Block {Margin: 0 5em 1em 5em; }
Take a snippet of HTML as an example:
& lt; Ul & gt; & Lt; Li & gt; & Lt; Span & gt; Blah blah blah & Lt; / Span & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "About:" & gt; Foo & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt;
When the browser & lt; Span & gt;
element, then it looks for the rules through all the stylesheets (browser, author, and user) and For this example, the author has a rule in the stylesheet:
ul {color: Green; }
does not specify the internal stylesheet color
value span
for your browser, so it continues till the document tree. As long as it finds > in this case ul
.
On the other hand, when Browser & lt; A & gt;
represents the element, this user or author does not specify any color
in the stylesheet, so this browser uses the rule found in the stylesheet.
The end result: green text, blue link.
Bonus information : If you are using Firefox, then you have resources in your internal CSS address bar: //gre/res/html.css
files by pasting (It seems that the direct hyperlink is confusing the Markdown engine of S.)
Comments
Post a Comment