1

I have this piece of code

.image.medium {
    width:10vmin;
    height:10vmin;
}

.image.small {
    width:6vmin;
    height:6vmin;
}

.image.medium.as_big {
    margin:5vmin;
}

.image.small.as_big {
    margin:7vmin;
}

AS you can se it contains those "vmin" units, which are not of use on IE9 because it uses "vm".

I don't have IE in my computer like to check, it's a linux computer anyway, so I don't know how I could make this css usable by both, IE9 and the other browsers.

Also I was thinking, should I use the javascript workaround instead? I just want vmin, according to http://caniuse.com/#feat=viewport-units it's not supported by so many browsers, and I would like to be able to zoom.

Onza
  • 1,710
  • 4
  • 18
  • 31

1 Answers1

6

Generally, standard declarations should be placed after the non-standard/experimental features.

For instance, in this particular case it should be:

.image.medium {
    width: 10vm;   /* fallback for IE9 */
    width: 10vmin;

    height: 10vm;  /* fallback for IE9 */
    height: 10vmin;
}

The latter declaration is interpreted by modern web browsers supporting vmin. And the former declaration acts as a fallback to the latter one.


Cross Browser Solutions

There are also polyfills for viewport relative lengths, for instance:

Community
  • 1
  • 1
Hashem Qolami
  • 97,268
  • 26
  • 150
  • 164