Home > Web Front-end > HTML Tutorial > [Scattered] A css hack_html/css_WEB-ITnose that can distinguish commonly used mainstream browsers

[Scattered] A css hack_html/css_WEB-ITnose that can distinguish commonly used mainstream browsers

WBOY
Release: 2016-06-24 12:13:24
Original
945 people have browsed it

It’s been a long time since I came to CSDN. I’m sorry for the motherland and the party. . . Only disperse! By the way, I would like to share something


Please indicate the source for reprinting, css exploration journey - the manor of drifting fog and rain

I have been unemployed recently, and I was quite busy at work before. I haven't updated my blog for several months. If you don’t think about doing something, or don’t take the initiative to do it, it will become a habit over time.

Damn css hack, yes, sometimes I will scold it like this, but it seems that I can’t completely throw it away at the moment. Nowadays, there are many demands for compatibility with browsers such as Safari and Chrome, and some projects even need to take into account IE5.5. Although I don’t agree with the frequent use of css hacks, sometimes they still need to be used. I integrated a CSS hack that can distinguish IE5.5, IE6, IE7, Firefox/Opera, Safari/Chrome at the same time. There may be a simpler version on the Internet than this. Just think of it as a mark.

[Demo address: http://www.doyoe.com/model/xhtmlcss/style/csshack.htm]

Code:

.test{
color:#00C;                                                                                                                                                                                                                                         /* For FF,OP * / [color: #000; color:#0f0;/*for sf, ch*/
*color:#ff0;/*for ie 7*/
_color:#f00;/*for ie6 */
}

Through the above styles, you can see blue words in IE5.5, red words in IE6, and yellow words in IE7, Firefox/ Opera sees black text, and Safari/Chrome sees green text. There is no further distinction between Firefox and Opera, Safari and Chrome.




Reply to discussion (solution)

Support sharing! You are worthy of the motherland and the party! ! ! Thank you

Check it out

Is there any version for IE8?

In fact, you can write why this is so so that everyone can learn from it

Provide an article for everyone to read http://www.scriptlover.com/post/545

~jF


Come and visit often: share and communicate with everyone often, and spread the word so that we can build the right party and the masses:)

It goes without saying: it is certain that LZ is still a good comrade

How to determine different browsers based on color?


Receive points and support! ^_^

Looked

Is there any version for IE8?

No IE8, because I don’t have IE8 on my machine yet


Support sharing! You are worthy of the motherland and the party! ! ! Thank you

Support

It’s too complicated

Learn and collect

Learn

If you have points, don’t grab it. Is it CSDN’s grab? Is the tradition in decline?

I have ie8 installed on my machine, and now I am in big trouble. ie8 is very close to ff3 (I mean CSS), and it is difficult to distinguish them in many cases.

Now I have to consider at least 4 of them at the same time: ie6, ie7, ie8, ff

Even if I don’t make any mistakes, testing all 4 of them one by one is exhausting and makes me crazy.

I really hope that everyone’s IE will be forced to be upgraded to IE8 by Microsoft overnight.

There is no day for turning around when it comes to web front-end.


Thank you for sharing

Follow up and share~~

Learned and shared the points

I’ll ask you weakly: Do this What's the use? ?

Let me ask you weakly: What is the use of doing this? ?

When the things you make need to consider multiple browsers, you will probably know the use of this ^_^


Not bad. Save it first. Maybe one day If necessary...

I will take a vacation when you come back. . .

Not bad

I will take a vacation when you come back. . .


Come on, the holidays are unpaid ^_^ Just get on with it

Black Art

JF
Learned

I have been researching this recently and lz helped me a lot! Firm support!

Layman learned

up

Support

Looks good

Thanks for sharing and learning

I will follow the CSDN tradition of receiving points. . Coming to pick up points.

Come and see often: often share and communicate with everyone, and only by spreading the word can we build the right party and the masses:)
It goes without saying: it is certain that LZ is still a good comrade

Support this one. .

Thank you

for supporting the original poster. Learn to add points by the way

Okay

Pick up...eat...

GOOD

Thanks to the original poster, I will add points by the way.

Open until 10 points for replying!
Is it true?

Support sharing! You are worthy of the motherland and the party! ! ! Thanks

for passing. .

Collect first and then read

Receive points

Not bad, worth learning

Learned

Tried it with Maxthon and Opera. . Well, that's right. .

What’s the use?>
Looking forward to it

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template