Archive for May 30th, 2008
An old CSS Trick
by z3n on May.30, 2008, under Tips & Hints
It’s been a long time i use this trick but i never got time to share it, so here it goes,
there are many different ways to have an specific css command to be interpreted by a IE or FF, but they are complicated some are obscure , other requires you to do a separated CSS file etc etc
here’s my trick:
.someclass {
width:250px; /* this is for FF */
//width:265px; /* this only works on IE */
}
so on FF it will ignore the commented line while IE will override the previous value with the one on the commented line; For some reason this works all IE versions i was able to test, somehow IE really loves to read the //’s , regular /* */ comments are ignored by both browsers.
that’s all.