CSS from the perspective of linguistics, logic, and System Theory
Liu Jianwen, http://blog.csdn.net/keminlau
)
Key: linguistic Logic System Theory CSS
Introduction
CSS is a document style description language. As a language, CSS has basic elements of the language, such as syntax and semantics. In addition, "programs" written with CSS are declarative language programs, this logic program is written to the rendering engine "read" of the browser. The relationship between the language, program, and browser involves the content of language, logic, and system theory. Let's take a look at the functions and roles of CSS as a machine language from the perspectives of linguistics, logic, and system theory.
View CSS from Linguistics
CSS (Cascading Style Sheets) is a style sheet language, which is a declarative language, opposite to common imperative languages (such as C language and JavaScript; as a language (a human language), CSS has basic elements of a language, such as syntax and semantics, as well as the purpose of communication and the logic subject of communication.
# Featured H2 A, # featured H2 A: visited {
Padding: 0px 0px 1px 0px;
Color: # c00;
Border-bottom: 1px solid # c00;
}
Natural Language [the logic subject of communication] is generally a person, and the [PURPOSE] of communication is to transmit ideas and complete life tasks;
CSS [logic subject of communication] One is a programmer, the other is a browser, and the [Purpose of communication] is to display the style of structured documents.
The semantics of natural language comes from things in the objective world;
CSS only applies to document styles, such as the format, color, position in the document, and text layout.
Natural language is used to transmit ideas, and the syntax is the subject-predicate structure;
CSS is used to display the style of structured documents. style rules are also a complete idea, and the syntax is the subject-and-verb structure.
In natural language, the [subject] [predicates] In the statement subject-to-verb structure are the properties of things and things from the objective world;
In the [primary-predicate structure] of CSS statements, the [subject] is an xthml tag, DOM object, custom class, and pseudo class, and the [predicate] is a style attribute, such as format, color, positioning, text layout, etc.
In contrast to CSS terminology, the statements in CSS language are [Rules]. The subject of a statement is [selector] And the predicate is [declaration ].
View CSS from logic perspective
Since CSS can be viewed from the perspective of language, CSS can be studied from the logic perspective, because language and logic are both integrated. Logic is the research of thinking, including the law of thinking and the form of thinking. Thinking will not be carried out in a vacuum, and it must be carried out using language. In the use of CSS, it is not about people, but about rendering engines of browsers.
P. Warning {font-weight: bold ;}
This CSS rule is translated into natural language, and the font style of any warning section is bold.
In contrast to CSS terminology, the CSS [Rule] is a proposition. For example: "…… The font style is bold. [attributes and values] in [selector] and [Declaration] are concepts, such as [paragraph], [Warning], [font style], and [bold ]; the entire declaration is the meaning of the selector concept. The document object set selected by the selector is the extension of the selector concept.
CSS from the perspective of System Theory
As we all know, language is a communication tool. Communication subjects-[people] and [browser rendering engine] are both systems. Language is used to transmit information between systems and complete system work. Verbal communication is a process that can be further abstracted. Simplified to [verbal work] is a single-direction [information] transfer between two systems. [A complete piece of information] Must be subject-and-Verb Structures, because a single subject or predicate does not do work, and there is no work or the work difference is zero. If the information is not a subject-and-verb structure, it is generally already default in the work situation, compared with the Sign Language HTML. There are two types of information transmitted: descriptive and command. There are two types of information transmitted in comparison to system work.
System work is the process in which the system sends information to the outside world. The purpose is to convert the work target from the initial state to the target State.
The speech process is a special form of system work. For details, refer:
In contrast to CSS terminology, CSS [the logic subject of communication] is a browser, a system, and [the purpose of communication] is to present the style of a structured document, that is, the system performs work; a css declarative program is a process of speech, a form of system work, and a CSS rule is a statement ".