CSS HACK for IE6/IE7/IE8/IE9/FF (summary)

CSS HACK for IE6/IE7/IE8/IE9/FF (summary)

Since I installed the official version of IE8.0, I have summarized several basic CSS HACKs. I hope it will be helpful to those who implement DIV+CSS in the front-end layout of web pages.
This article mainly focuses on: IE6+IE7+IE8+IE9+FF

HACK principle : Different browsers recognize different characters differently (after reading the article, you will find that FF and IE8 have exactly the same ability to recognize the following characters)
Commonly used special character recognition table in CSS:
(1) *: IE6+IE7 can recognize *, but standard browsers FF+IE8 cannot recognize *;
(2) !important: Except for IE6, FF+IE8+IE7 can recognize !important.
(3)_: Except for IE6, FF+IE8+IE7 do not support_;
(4)\9: All IE browsers recognize (IE6, IE7, IE8, IE9)
(5)\0: Only valid for IE8

Example :
(1) Differences between FF (IE8) and IE6 and IE7
backgorund:orange; The background color of FF and IE8 will be orange
*backgorund:red; IE6 and IE7 background color will be red
(2) Differences between FF (IE8) and IE6 and IE7
background:orange; FF and IE8 background color will be orange
*background:red !important; IE7 background color will be red
*background:blue; IE6 background color will be blue
(3) Differences between FF (IE8) and IE6 and IE7
background:orange; FF and IE8 background color will be orange
*background:red; IE7 background color will be red
_background:blue; IE6 background color will be blue
(4) Differences between FF and IE6 IE7 E8
color:gray; The font color of non-IE browsers such as FF will be gray
color:red\9; IE8 IE9 font color will be red

You can understand it at a glance :

Copy code
The code is as follows:

<style>
div{
width:400px;
height:400px;
background-color:red;
background-color:blue\9; /*All IE*/
background-color:yellow\0; /*IE8 hack*/
_background-color:#CDCDCD; /* ie 6*/
*+html background-color:white; /*IE7 only*/
*background-color:pink; /*IE6 IE7 hack*/
@background-color:white; /*opera hack*/
}
</style>

<<:  Introduction to JavaScript array deduplication and flattening functions

>>:  A practical record of checking and processing duplicate MySQL records on site

Recommend

Docker uses root to enter the container

First run the docker container Run the command as...

Mysql optimization techniques for querying dates based on time

For example, to query yesterday's newly regis...

Getting Started: A brief introduction to HTML's basic tags and attributes

HTML is made up of tags and attributes, which are...

The neglected special effects of META tags (page transition effects)

Using js in web design can achieve many page effec...

Gradient slide effect implemented by CSS3

Achieve results Code html <div class="css...

How to try to add sticky effect to your CSS

Written in front I don’t know who first discovere...

CSS pseudo-element::marker detailed explanation

This article will introduce an interesting pseudo...

Detailed explanation of the usage of grep command in Linux

1. Official Introduction grep is a commonly used ...

Html+CSS drawing triangle icon

Let’s take a look at the renderings first: XML/HT...

How to connect to docker server using ssh

When I first came into contact with docker, I was...

Solution to 1045 error in mysql database

How to solve the problem of 1045 when the local d...

Solution to garbled display of Linux SecureCRT

Let's take a look at the situation where Secu...

Let's talk about bitwise operations in React source code in detail

Table of contents Preface Several common bit oper...

Introduction to JavaScript built-in objects

Table of contents 1. Built-in objects 2. Math Obj...