Browser Specific CSS Rules

Here is an idea that I had, when I was designing a website for a friend, about CSS standards and browser implementations. Opera, Safari and konqueror all render extremely well; Firefox is pretty good but still has some bugs; and Internet Explorer just sucks ass. I always have to break the standard by adding special '_' css rules that only IE parses. It annoys me slightly because it is not standards compliant, but it is incredible useful because I can now override the real rules with special IE rules.

This got me thinking, why doesn't this exist for every browser. Lets put asside notions of a perfect world where ever browser renders each page exactly because that will never happen. There will always be bugs and differences between browsers. The current solution is to use hacks that exploit bugs in the parsing engines or to detect the browser and pass it a special .css file. Hacks, like the box model hack shown below are not good solutions.

div.content { 
  width:400px; 
  voice-family: "\"}\""; 
  voice-family:inherit;
  width:300px;
} 

html>body .content {
  width:300px;
}

Now imagine being able to use a simple single css rule instead of the hack?

div.content {
  width: 300px;
  ie5_width: 400px;
}

Browser directed rules could be any valid CSS rule but with a special browser specific prefix. This prefix could consist of a browser code (IE, MOZ, FF, SAF, OP, KON, etc.), optionally a verions number and an underscore ('_').

Examples:

op_border: 4px;
ie_width: 400px;
ff1.5_padding: 4em;

If every browser implemented a scheme like this it would be much easier to work around their quirks and bugs. It would also be much cleaner than resorting to hacks.



Netwookiee (not verified)

Well that would be one way...

While we are dreaming up ideas, I think it would be better if there was a single standardization that all browsers had to follow before being released. Make Microsoft, Apple, Firefox, etc. all conform to the same standard. That way we wouldn't have to worry about hack code and modding CSS.

I don't think that will happen anytime soon. There will always be differences or bugs so long as the rendering engines are developed independantly.

I figured something like this is incredibly easy to implement so it may get there faster.

Landseer (not verified)

Farming for wow gold (world of warcraft gold) isn't easy, but you can buy cheap wow gold, wow power leveling on sale. Buy wow gold here, we sell cheap world of warcraft gold. Buy wow gold age of conan goldage of conan goldage of conan goldaoc goldaoc goldaoc goldnow,I think you will have your pleasure.We have revolutionized the exchange of money to wow gold with fast delivery.Purchase world of warcraft gold online and world of warcraft gold power up your character to the next level.Welcome to our website about world of warcraft gold,delivery in 24 hours,7/24 service.

Post new comment

The content of this field is kept private and will not be shown publicly.