Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do we need multiple background-color rules? [duplicate]

Tags:

css

less

I'm a novice in Css and it's difficult to search for this specific case on the internet, so I post a question here.

I'm working on an existing code base and I see something like this.

li {
  background-color: #000 \9;
  background-color: rgba(0, 0, 0, 0);
}

I don't understand the meaning of \9. But it looks to me the rules are duplicates and I should remove one of them.

Could you please explain the \9 and should I remove one rule? Thanks.

The reason I'm asking because I'm converting some css files to less files and \9 is causing a compilation problem.

like image 670
Khanh TO Avatar asked Oct 28 '25 09:10

Khanh TO


2 Answers

\9 is an old Internet Explorer hack, which makes it work in IE only (8 and lower) rgba is the way to go you can safely delete the \9 rule

like image 135
nire Avatar answered Oct 30 '25 00:10

nire


This is a CSS hack for IE 7, 8, & 9.

To find out more, please check this link.

like image 25
Punitha Subramani Avatar answered Oct 30 '25 00:10

Punitha Subramani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!