Learn css (TODO) and csstodo
1. What role is css?
A: css controls the webpage style.
Extension: div + css is a classic web page layout. Separate webpage content from presentation.
2. How does css work?
Answer: 1. inline style: directly add css styles using style attributes in HTML tags
<Div style = "color: red"> red text </div>
2. Embedded: Write the css style in the <style> label of the header.
<Head> <style type = "text/css"> p {color: red ;} </style>
3. External style: Write css in a separate external file, and then use the <link> label to reference
<Head> <link href = "base.css" rel = "stylesheet" type = "text/css"/>
Base.css file:
P {color: red ;}
Priority of the three methods: proximity principle
3. css composition?
Answer: Selector + Style
1. selector (separated by commas)
1. Tag Selector
p {color: red;}
2. id Selector
#test{color:red;}
3. class selector
.test{color:red}
4. derived Selector
TODO
5. Attribute Selector
[title]{color:red}
2. Style
1. Box Model
Tip: 1. Apply the background to an area consisting of content, padding, and border.
2. Adding the padding, border, and margin does not affect the size of the content area, but increases the total size of the element box.
2. Positioning