Stuart Wright
Well-known member
So the Modernizr script alters the html tag to add specific classes depending on what the browser is capable of.
So the latest Chrome would have an svg class added because it supports svg images.
But IE8 would have a no-svg class added because it can't.
And then we can use svg or png sprites depending upon which is supported like this:
Except these classes aren't being added to the html tag. I don't know why and I'm flailing round in the dark a little bit.
Anyone used Modernizr who can share any tips?
Thanks
So the latest Chrome would have an svg class added because it supports svg images.
But IE8 would have a no-svg class added because it can't.
And then we can use svg or png sprites depending upon which is supported like this:
Code:
.background-class {} /* Shared properties for detected features */
.svg .background-class {background:url(styles/default/sprite.svg);} /* SVG feature property */
.no-svg .background-class {background:url(styles/default/sprite.png);} /* PNG feature property */
Except these classes aren't being added to the html tag. I don't know why and I'm flailing round in the dark a little bit.
Anyone used Modernizr who can share any tips?
Thanks