IE7 targeting hacks working in Opera when the xml prolog precedes the doctype

I recommend that before using any of these hacks that you look at this page and also google the older blog page by David Hammond.

* html - target IE 6 and earlier

*+html - target IE 7 and Opera 9.10 and 9.24

*~html - target IE 7, Opera 9.10 and 9.24 and Opera 9.5 alpha



*:first-child+html - target IE 7

html:first-child - target Opera 9.10 and 9.24

*+html:first-child - target Opera 9.10 and 9.24

<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

<html xmlns="" xml:lang="en-gb" lang="en">

  1. CSS hacks
  2. Internet Explorer and the CSS box model
  3. Writing cross-browser CSS
  4. prepared for IE7 - feeding separate styles to Internet Explorer with the @import hack
  5. Thanks to Philippe Wittenbergh for sharing with me the details for Opera 9.5 alpha

CSS Class test