Skip to content
fredchu edited this page May 15, 2012 · 3 revisions

Browser hacks

all browser

.sample {
  color: #006699;
}

all ie

.sample {
  color: #006699\9;
}

ie8, ie7

.sample {
  color/*\**/: #006699\9; 
}

ie 7 and modern browsers only

html>body .sample {
  color: #006699;
}

ie 7 only

*+html>body .sample {
  color: #006699;
}

ie 7 only

*:first-child+html .sample {
  color: #006699;
}

ie 7 and below

.sample {
  *color: #006699;
}

ie 6 and below

* html .sample {
  color: #006699;
}

ie 6

.sample{
  _color: #006699; 
}

modern browsers only (not ie 7)

html>/**/body .sample {
  color: #006699;
}

opera 10

@media all and (-webkit-min-device-pixel-ratio:10000),not all and (-webkit-min-device-pixel-ratio:0) {
  .sample {
    color: #006699;
  }
}

opera 9 and below

html:first-child .sample {
  color: #006699;
}

webkit only ( chrome & safari )

@media screen and (-webkit-min-device-pixel-ratio:0){
  .sample {
    color: #006699;
  }
}