CSS is the first thing you know.
CSS stands for Cascading Style Sheets, that is, Cascading Style Sheets
CSS is a language that represents file styles. It can also be said to be a user-seen interface. It is a language that truly achieves separation of presentation and content.
I. Basic syntax
Rules: CSS rules are mainly composed of selector and one or more declarations.
Selector: a tag defined in a code segment. It is used as a tag for CSS recognition.
The Declaration is to set the format of the content in the selector.
Instance:
In the code segment, set the selector as follows. Style is used to mark the text "Upgrading"
<Div id = "style"> advanced training </id>
In CSS, you can use the selector to set the format of the text "Upgrading the class ".
#style{
font-size:12px;
text-decoration:underline;
color:#fff;
}
In this way, you can set the font size, underline, and font color of the text "improve the class ".
In this way, CSS also embodies the idea of object-oriented abstraction. It abstracts the File Settings and implements them using the CSS language to reduce
This reduces the burden on web code and makes it easier to design patterns. You can mark and modify a type of files in a unified manner.
Ii. Usage
The above is the basic syntax of CSS, but there are multiple methods when using style sheets. The main methods are as follows:
1. External Linking: link a webpage to an external style sheet
This style is used to create a web layer without words. The first task is to drag a public style table to the newly created web.
Advantage: When styles need to be used on many pages, you can change the effect of multiple pages by changing a folder in the external mode.
2. Inline: as the name suggests, it is embedded into various elements of the webpage.
<p style="color: red; margin-left: 20px"> This is a paragraph </p>
When some special styles on a webpage need to be applied to individual elements, you can use embedded styles and write them directly in the code.
3. Embedded Embedding: A style sheet embedded in the wear part on the webpage
Embedded style sheets can be used to embed special styles into a single file.
Differences between inline and embedded
I personally think that the two biggest differences are that they have different scopes. The Inline expression acts on individual elements while the embedded one acts on files.
The essence is the same. They are all embedded in webpages.
Iii. Summary
CSS, as a style design language, has a very high precision. From the cool, we can find that it can be accurate to the unit pixel.
In addition, it also sets almost all text styles, which are very easy to understand.
The above is just a glimpse of CSS knowledge. There are still many things to learn about CSS, and there will be a lot of selectors and CSS core content in the future.
Summary