I believe most developers do not have multiple spaces.
This happens when most CSS formatting on the Internet formats the compressed CSS.
Search "CSS formatting" for the following websites
Softbar
Http://www.softbar.com/
After formatting, there will be more spaces. If there are more spaces, the style rule will become invalid.
01
<! Doctype HTML>
02
<HTML>
03
<Head>
04
<Meta charset = "UTF-8">
05
<Title> when writing CSS pseudo classes, multiple spaces before or after the colon will invalidate this rule </title>
06
<Style type = "text/CSS">
07
A: link {
08
Color: Gray;
09
}
10
A: visited {
11
Color: red;
12
}
13
/* There is a space after the colon */
14
A: hover {
15
Color: yellow;
16
}
17
</Style>
18
</Head>
19
<Body>
20
<A href = "http://www.sina.com.cn"> Sina </a>
21
</Body>
22
</Html>
Test hover rules in all browsers does not work.
The same is true if a space is added before the colon.
Note ..