CSS generally has no conditions or other dynamic structures.
Your problem has been resolved with the so-called "font stacks". You declare a font-family with a comma-separated list of font names. Now the client browser selects the font from the list that it has. Therefore, creating good font stacks is a difficult task (because they should look similar or at least have the same letter spacing / line height). If you use Google for web font stacks, you will get good articles about this topic from professional font resellers who have already done the work for you by creating beautiful font stacks.
An alternative nowadays is to provide the font you want as a downloadable font through the @font-face declaration. However, keep in mind that:
- you need several formats to support all browsers
- they add extra weight to the page loading, which may be relevant to mobile phones.
- You need the right to use a font or use a free font (Google offers a service in which you can choose from a variety of free fonts).
source share