When writing CSS pseudo-classes, multiple spaces before or after the colon will invalidate this rule-softbar

Source: Internet
Author: User

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 ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.