1. Space operator
(1) CSS language
Simply put, CSS language is similar to JS language. It is downloaded by the client and parsed by the local browser. The CSS language is a very low-level "weakly typed" language. It is still far away from a relatively complete object-based "weakly typed" language like JS. You must know that CSS styles are defined, and the presentation of styles is based on the document flow order and CSS priority level, and is displayed after the browser recognizes and calculates it. And browsers have ignoring and error correction functions (especially IE), so if the syntax of the style definition is wrong, it will not affect the normal operation of the browser, but it will not display the desired effect. When we design and define styles, troubleshooting is more distressing. The essential reason is related to the looseness of the weakly typed CSS language itself. Therefore, we should pay more attention to the strict prohibitions of CSS definitions in order to make mistakes. Fewer errors, better work done faster.
(2) CSS operators
First of all, there are not many operators in the CSS language. There are .#{}:"; and a very important space. These operators are commonly used definition declaration symbols. In CSS style definitions, spaces It's a bit special, we can think of it as the . operator in a namespace or class package definition in .Net or Java. In other words, we can think of spaces as arrows pointing to paths, indicating the parent-child level relationship of HTML tags. . CSS is related to HTML, that is to say, each definition of CSS corresponds to "a certain HTML tag" or "a certain modular HTML code", and HTML can call multiple CSS style classes. Classes can be "compositely defined" based on HTML code; an HTML tag can also be "compositely called" into multiple style classes. Therefore, the complexity of CSS style definition is inseparable from the associated HTML.
(3) Example description
The following is the quoted content: <style type="text/css"> |
explain:
1. The class path of the first class b is td.b, which defines the style of tags with class="b" in all td tags in the HTML document.
The following is the quoted content: td .b { |