Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which CSS hack can pass the w3c validation?

Tags:

css

xhtml

Which css hacks we use to make layout cross browser compatible

  • Can pass W3C validation
  • Will work forever
  • Will never create in any future browser versions

What are alternatives which can pass the w3c validation for popular CSS hack which are not valid?

for example

underscore hack, zoom:1 etc.

my purpose is to make a list of W3C validated and non problematic CSS hacks and techniques which can be helpful to make CSS layouts cross browser compatible.

mainly we use CSS hacks for IE , but sometime we need Hacks for other desktop browsers also.

Main Concerned browsers are:

  • IE6, IE7, IE8
  • Safari latest final release
  • Firefox 3.6, 3.5 , 3.0 and 2.0
  • Opera Latest final release
  • Google Chrome latest
like image 453
Jitendra Vyas Avatar asked Feb 27 '10 10:02

Jitendra Vyas


1 Answers

Here is the list:

  1. Easy selectors
  2. Minimized attribute selectors
  3. !important
  4. @import "non-ie.css" all;
  5. body[class|="page-body"]

They are listed here: In-CSS Hacks.

However, nobody promise they will work forever.

The best approch for IE hacks is to use conditional comments.

like image 196
Sagi Avatar answered Oct 11 '22 07:10

Sagi