Basic css knowledge + css Selection Characters (element Selection Characters and link selection characters), basic css knowledge
First, I will introduce how to import css styles in html webpages.
1. Intra-row style: <p style = "color: red"> Use css for intra-row style </p>
2. In-page style: Set in the head label
<Span style = "font-size: 18px;"> 3. External link mode: First, you must prepare a css style sheet externally.
<Span style = "font-size: 18px; "> Next, I will introduce css cascade styles.
Element selector: class selector, id selector, class selector, and wildcard Selector
Type selector: select an element class label.
<span style="font-size:18px;"><style> h1{ color:blue; }</style></span>
Id selector:
<span style="font-size:18px;">
Class selector:
<span style="font-size:18px;">
Wildcard character selection:
<span style="font-size:18px;">
The type selected by the wildcard is abstract, so use it with caution!
Next, we will introduce the relationship selector, including the selector, subselector, adjacent selector, and sibling selector.
Contains the selector:
<span style="font-size:18px;">ul li{color:red;}</span>
All the li labels below ul labels are set with styles
Sub-selector:
<span style="font-size:18px;">Ol sublevel elements are selected
Adjacent selector:
<span style="font-size:18px;">Select the sibling level li element next to the li tag
Sibling selector:
<span style="font-size:18px;">Select All sibling elements behind the li tag
The above is what I want to introduce.
In addition, I would like to add a few points:
First line indent: text-indent: 4em;
Center display: teext-align: center;
Priority:
In-row css> On-page css> external css
# Id>. class
If the style set later already exists, the style set later will be overwritten.
For example:
Specifically, it must overwrite the abstract
For example, if you use the set wildcard to select a matching element selector, the part that uses the element selector will not be overwritten by the wildcard selector.