Using CSS
1,css is a cascading style sheet (cascading style Sheet), consisting of a selector and a declaration block. The first section below H1 is the selector, and the curly braces surround the block that is the declaration block.
{ color: red;}
2,css use is mainly divided into external style sheets, embedded style sheets, and inline style sheets.
/* external style sheet */ <link rel= "stylesheet" href= "Base.css" > /* Embedding Style Sheets */ <style> { color: red; } </style> /* Inline style sheet */
3, the selector is used to determine which elements the style sheet is to be applied to. There are five types of selector categories available: element name, category, pseudo class, attribute, ID
(1) On the priority level, the ID is the highest priority, the element name is the lowest, and the category and attribute are the same.
(2) The selector can be used in combination. The blend selector priority is calculated from the right to the left. For example, H1.very is higher priority than very h1, so the elements that satisfy both are preferred to use the h1.very style. If the priority level is the same, the style that appears after use
(3) Mixed use selector:
A, element name: combined with a homogeneous selector, which represents a parent-child element relationship separated by a space, and a comma-separated representation of an equal relationship
B, category with dot number + class name
C, pseudo-class using Colon + pseudo-class name
D, the property uses [name= "value"] property value is not filled when [name] means that the property value is not restricted, the available matching patterns are =, ~=, |=, *=, ^=, $=
E,id with #id
/* H1,H2 Elements */ /* H1 all H2 child elements */*/*H1 direct H2 child elements * / /* * */*H1 behind the half-element H2 element * / { }
CSS Learning (1) Selector