Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: [CSS Tips and Tricks] One CSS fits (almost) all browsers  (Read 2954 times)

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
[CSS Tips and Tricks] One CSS fits (almost) all browsers
« on: February 09, 2008, 11:30:19 am »

No!
I was just kidding. ;D
But,
I've learnt something this morning you might already know.

With IE6, we can hack a CSS by placing an underscore before the element of a class:
Quote
.yourclass {
        width: 150px; /* for all (?) browsers */
        _width: 150px;  /* for IE6 */
}
For IE7, you just have to type a dot before the element, so this is how it looks:
Quote
.yourclass {
        width: 150px; /* for all (?) browsers */
        _width: 170px; /* for IE6 */
        .width: 190px; /* for IE7 */
}
This is 100% quick and dirty code (better use for validation conditionnal comments) but,
for quick debuggings it helps a lot.

Joost

  • Guest
Re: [CSS Tips and Tricks] One CSS fits (almost) all browsers
« Reply #1 on: February 09, 2008, 12:31:48 pm »

Very useful Philippe,

The IE7 trick, I did not know. The IE6 trick might (from memory) validate.

Here is a fresh karma (the old one smells):D
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [CSS Tips and Tricks] One CSS fits (almost) all browsers
« Reply #2 on: February 09, 2008, 12:53:50 pm »

Here is a fresh karma (the old one smells):D
...and I don't like even numbers. Thanks fort it.

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
Logged
"It's only dead fish that goes with the flow... "
Updated