The most concise CSS learning notes

小云云
Release: 2017-12-12 13:59:46
Original
4425 people have browsed it

CSS is a computer language used to express file styles such as HTML (an application of Standard Generalized Markup Language) or XML (a subset of Standard Generalized Markup Language). CSS can not only statically modify web pages, but can also cooperate with various scripting languages ​​to dynamically format various elements of web pages. CSS can perform pixel-level precise control of the layout of element positions in web pages, supports almost all font sizes and styles, and has the ability to edit web page objects and model styles.

1. Common attributes


  1. name: name, can be repeated, can be the same;

  2. class: The class name can be repeated or multiple, for CSS; such as

    ;

  3. id: unique identifier, cannot be repeated, generally used in JavaScript; the naming rules are the same as those of other languages;

  4. title: title, which can be added in the tag; such as ;

2. Tag relationship


  1. Descendant relationship: parent-child relationship (including relationship);

  2. Brother relationship: same-parent relationship;

3.CSS-Cascading Style Table


  1. CSS comments:/The comment content is written here for the programmer to see and will not be displayed on the page/;

  2. CSS grammar rules: All symbols must be entered in English input mode, in lowercase, and attributes must be written in braces. Each attribute statement must end with a semicolon, and the attribute value must have a pixel unit (px); format : Attribute: attribute value;

4. How to introduce CSS


  1. Inline introduction: How to introduce styles in tags ;Format: Content;Note: The maintainability of the code is extremely poor, and the CSS code and html structure are not separated ;The scope of influence is only in the current tag;

  2. ##Inline introduction: add