Selector,selector,selector {Property:value;property:value ...}
CSS Selectors can be divided into two main categories: (signature, attribute)
A. basic selector: Wildcard, tag, ID, class and attribute selector
B. Combo selector: Group selector, descendant selector, child selector, and adjacent sibling selector. Also called derived selectors: Use the format of the parent element child element to navigate to a child element under a specific parent element.
Here is a copy of HTML:
1) tag Selector with tag name as selector
h2 {color:red;} div {color:red;}
2) The ID selector applies a style to a label that specifies the ID property value, starting with # to define
#p1 {color: #00ff00; font-size:40px;}
3) Class selector to apply styles to certain tags of the specified class property value, starting with the.
. cs {Color:blue;}
4) The property Selector Property Selector allows you to select elements based on their attributes [and property values].
A. Match by property name, and include the property name in [].
[Title] {color:gray;font-size:20px;}
B. match by property name and property value, and include the property name and value in []
[title= ' DT '] {color:gray;font-size:20px;}
5) Wildcard selector to configure any label
* {font-size:30px;}
1) The group selector applies the specified style at the same time for multiple labels or multi-class labels, separated by the middle
H2, #p1,. cs {color:green;}
2) Descendant selectors can be found as long as they are descendants, no matter how many layers.
Div span {color:blue;} <div title= "DT" >
3) The child selector must be a direct sub-element here
Div>span {color:green;} <div title= "DT" >
4) Adjacent sibling selector
H3+span {color:orange;} <div title= "DT" >
5) Hyperlink Dependent selector
The default style for hyperlinks is blue, with the underline line added. Hyperlinks have the following 4 selectors:
A:link setting hyperlinks in deprecated CSS styles
A:hover setting CSS styles when the mouse hovers over a hyperlink
A:active CSS style When a hyperlink is set to be activated by the user (event between mouse click and release)
a:visited to set CSS styles for hyperlinks that have already been visited
Then the default hyperlink is blue with an underlined style, if I want the hyperlink to be black and not underlined, and then when the mouse moved to the top of the line when the underline, click on the hyperlink after the program red, so how to design the effect?
css--Selector