DIV + CSS learning summary, divcss Summary
DIV + CSS is the WEB design standard. It is a WEB page layout method. Unlike traditional table layout positioning, it can separate webpage pages from presentation.
Because there are a lot of contacts with CSS in niujiao and JS. Now, when I study DIV + CSS again, I am no longer familiar with it. It is a resonance ~~
No matter how you set CSS stylesSelectorAndStyle Sheet.
Style Sheet
There are three main types of style sheets. These are embedded style sheets, external style sheets, and inline style sheets.
Embedded style sheet
Add a style sheet between html
Example:
<Head> <title> example </title> <style type = "text/css"> # color {font-color: red ;}</style>
Inline style sheet
Insert a style directly into an html Tag
Example:
<H1 style = "color: red"> example External style sheet
Create a new CSS file and insert it into the HTML code using the link statement.
Example:
<Link type = "text/css" rel = "stylesheet" href = "css/ ..css"/>
Selector
There are also three commonly used selectors: ID selector, class selector, and tag selector.
ID Selector
In HTML, you can add an ID to the element to determine its position. At the same time, the ID must be unique and cannot be repeated. You can set a style for the tag by using the ID.
Example:
Set a color id for the p tag.
<P id = "color"> example </p>
The css id selector is used to change the color of the content in the <p> label.
#color{font-color:red;}
Class Selector
In HTML, you can add class attributes to tags and set attributes for tags through class.
Example:
Set a class called color for the p tag.
<P class = "color"> example </p>
The css class selector is used to change the color of the content in the <p> label.
.color{font-color:red;}
Tag Selector
Change the style of the content in the tag Based on the HTML Tag.
Example:
Change the text color of the <p> label
<P> example </p>
Use the tag selector to change the text color in the <p> label.
P{color:red;}
Summary
Selector and style sheet are the most basic content in CSS. With these skills, you are more comfortable with learning other things.
During video learning, I also learned the comprehensive use of CSS, JavaScript, CSS, XML, CSS, and Ajax. However, I do not know much about it. I still need to practice more to further deepen my understanding.