0

I know that most of the "modern" browsers supports @font-face in CSS. But there may be some exceptions. I would like to know if it is possible to change font size of some selector based on @font-face browser support. ie, I would like to set font-size of a <span>.

I want 20px if browser support @font-face and 30px if not. How can I make this possible? It will be great if this can be done by using pure CSS.

halfer
  • 19,824
  • 17
  • 99
  • 186
Alfred
  • 21,058
  • 61
  • 167
  • 249

1 Answers1

0

I think here you should be use IE Hacks and you can also read about other hacks chrome and firefox to be able check versions and match them, but i wanna focus on specifiec browser - Internet Explorer

So as i started to say, you can use IE hacks to match fontsize, example:

<!--[if IE]>
<style>
 span{
  font-size: 30px;
 }
</style>
<![endif]-->
 <style>
  span{
   font-size: 20px;
  }
 </style>

Like I said, you can use firefox/chrome and other browsers css "hacks" to check version, and check supporting @fontface, I've not gave you fontface example since I don't have link and i perfer not make a confuse.

Hope I helped.

EDIT: I'm not sure if I'm clear then I would like make a fast point:

You can check each browsers (also each version) and see if he support fontface, if he doesn't you just use the same browser hack to change span font-size.

copypaste
  • 175
  • 1
  • 2
  • 13