Home >Web Front-end >HTML Tutorial >CSS (1) Preliminary understanding_html/css_WEB-ITnose
Through the Brisket News Release System, I came into contact with CSS, and I also felt its advantages of being simple, convenient and easy to change when doing Web front-end development.
Especially the later learning and understanding of CSS boxes makes people realize that web design, like many things, contains profound thoughts and design skills, blending into life and expressing life.
This article is mainly about some personal understanding of the overview of CSS content.
CSS, cascading style sheets. It truly achieves a style design language that separates the web page presentation layer from the content, and achieves a decoupling effect of a code control interface that is simple and easy to modify.
Through CSS, we can precisely control the position of objects down to the pixel level, and we can also design object styles and styles at will to achieve optimal aesthetics.
The following are some features of CSS.
1. Selector and priority.
Selector Here we introduce the ID selector and class selector.
We can understand the ID selector like this: we assign a unique ID to an object, and we can control the object through this ID. Just like operating a database by ID number. The ID selector is defined by "#".
Class selector: We create a class, give it a class name, and then we can manage this class uniformly through this class name. This class can contain many concrete objects.
Of course, we can also specialize certain objects in class selectors, because universal and special can never be separated. For example, for the object "Little Apple", we can set the special color of "Apple" and so on.
Priority refers to the order in which CSS styles are executed in the browser, which is actually the order in which the code is executed.
Generally speaking, it is executed sequentially, but sometimes conflicts may occur in the code. For example, if an object a is included in a class, we not only specify in the code that all objects in the class should be displayed in red, but also specify that a should be displayed in yellow, this requires priority.
CSS medium priority: ID selector, class selector, HTML.
For more specific divisions, see Baidu Encyclopedia (http://baike.baidu.com/view/939547.htm): inline style (inline style) > ID selector > Class selector ( class), pseudo-class (pseudo-class) and attribute * (attribute) selector> category (type), pseudo-object (pseudo-element)
2. Core
The core of CSS In fact, it is the use of CSS boxes, including knowledge of standard flow, models, floating, positioning, etc. I will introduce it in detail in subsequent blogs, so I won’t go into details here.
3. The difference with CSS DIV
CSS refers to cascading style sheets.
DIV is a tag element in HTML language and is a layout element.
DIV CSS means that we can use CSS to control DIV layout.
You can imagine that DIV is a text or rectangular box, and CSS controls where they appear on the web page and how they appear.
Just like the current blog page, you can see a lot of "boxes". If you look at the source code of this webpage, you will also see a lot of "DIV": style="attribute:attribute value;attribute:attribute value" in the tag ;..." is the CSS applied to the tag. This is one of the ways to use CSS.
Summary: Using CSS DIV for web development is the current mainstream. Knowledge in this area requires us to fully understand its implementation principles, practice and learn CSS boxes, so that everyone Everyone will become a master of web page production~