Style is a very ambiguous word. Asking "What is a style?" Is a philosophical approach that is equivalent to "what is truth". It is more difficult to ask this question "What is a good style?" The boundaries of society are constantly facing the definition, especially the acceptance or elimination of projects in art and writing. However, in all of these changes, certain elements remain the same, and these elements are the elements that the style manual is trying to determine. Before class reading and blog projects started, I thought that style was the way the artists used to convey their thoughts to readers.
In the embedded style, the styles we write are different from the elements. So we need a way to associate an element with its style. The first word "div" is like this. This lets the browser know that all the style {...} in curly brackets belongs to the "div" element. This clause is called a selector to determine the element to which the style is applied. So, how does the browser decide which version of HTML is used to create the page? To let the browser know that you are using HTML5, you need to include it at the top of the page. In older versions of HTML, this line was different, but since you no longer use it you do not need to understand it.
The source of the style sheet is the default style sheet of the browser, the style sheet provided by the page creator, and the user style sheet. These are style sheets provided by browser users (you can define favorite styles in the browser). If it is not optimized, finding matching rules for each element can cause performance problems, it is cumbersome to repeat the entire list of rules for each element and find a match. Task: The selector turns out to be useless and can have a complex structure that allows you to start the matching process from a seemingly promising path that seems to need to try another path.
A style sheet is a set of style rules that you can apply to a selected set of HTML elements. Style rules are used to control the appearance of HTML elements such as font attributes (typeface, size, thickness, etc.), color attributes (background color, foreground color, etc.), placement, margins, borders, fills, I will. This is the same style as other release software like WinWord and LaTex. When more than one rule is applied, attributes are accumulated. However, if there is a conflict, the last rule will be in effect. For example, rules 3 and 4 apply to <h2>. <h2> Accumulate attributes of both rules. This takes the thickness of bold in rule 3 (not specified in rule 4), but uses rule in rule 4 (blue instead of rule 3).