Four ways to introduce CSS in HTML
1. Inline type
Style= "XXX" is written in the label
<= "color: #000;" >
2. Embedded type
Write the style tag in the head tag
< style > H1{color: #000; }</style>
3. Import type
Use @import= "Css_file" in the Style tab
< style > @import "style.css"</style>
4. LINK Type
Using the link tag and href= "Css_file"
<rel= "stylesheet" href= "Style.css " type ="" Media ="" />
Basic selector for CSS
1. Tag Selector: tagname{}
2. Category selector:. classname{}
3. ID selector: #idName {}
4. Wildcard: *{} means the element within the page
CSS Composite selector (Permissions: direct > Space > Comma)
1, intersection selection: Middle no space (between the basic selector)
Indicates that multiple selectors are satisfied
2. Set selection: separated by commas (",") (between basic selectors)
Indicates that the front and back selectors satisfy one of the
3. Descendant selection: separated by a space ("") (between the basic selectors)
Represents the latter in the former
Precedence in CSS
Style inline > #id样式 >.class style >tag styles
How HTML introduces CSS, and CSS selectors