Solve the problem that the style does not appear after the hyperlink is clicked to access
I have clicked on the link and then returned, the link will change color and will not change back
We have set a:visited and a:hover at the same time
hover styles no longer appear
As long as we slow down the two positions
a:hover{color:yellow;} a:visited{color:green;} If you do not click on the A label, the color will turn yellow when the mouse is over, but after clicking on the a note, the color will turn green It doesn't turn yellow when the mouse is over
We just need to swap their positions. a:visited{color:green;} a:hover{color:yellow;} In this way, whether it is clicked or not, it will slide over and change color
Centered
Simple text and image centering only need to set the parent element
text-align:center
Text, pictures, etc. will be centered in the line
Centering block-level elements
A block-level element with a determined width is centered by setting margin-left:auto margin-right:auto
Block-level elements of indeterminate width
Set display to inline type for block-level elements and set text-align: center to center
However, if it is set as an inline element, it will have fewer functions than block-level elements, such as setting length and width.
You can also set float to the parent element and then set the parent element to position: relative and left50%
Child elements set position: relative and left: -50%
It is possible to keep block level elements still in the form of display: block
Browser compatibility selector prefix Through the prefix, you can know what browsers it supports and what browsers do not support
gt(great than): select the version above the conditional version, excluding the conditional version itself; lt(less than): This is just the opposite of gt, indicating that the version below the conditional version is selected, excluding the conditional version itself; gte(great than or equal): select the version above the conditional version, and include the conditional version itself; lte(less than or equal): select the version below the conditional version and include the conditional version itself
Support all IE browsers
<!--[if IE]>
<link rel="stylesheet" href="test.css" type="text/css"/>
<![endif]-->
Support all browsers except ie
<!--[if !IE]> <link rel="stylesheet" href="test.css" type="text/css"/> <![endif]-->
Support ie10 browser
<!--[if IE 10]> <link rel="stylesheet" type="text/css" href="ie10.css"> <![endif]-->
Support browsers below ie9
<!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="ie9-and-down.css"> <![endif]-->