1

I wonder if I can define multiple font-family names in my CSS for the same font (file).

@font-face {
  font-family: 'Cool font';
  src: url('bumblebee-webfont.eot');
  src: local('☺'), 
       url('bumblebee-webfont.woff') format('woff'), 
       url('bumblebee-webfont.ttf') format('truetype'), 
       url('bumblebee-webfont.svg#webfontg8dbVmxj') format('svg');
}

@font-face {
  font-family: 'New font';
  src: url('bumblebee-webfont.eot');
  src: local('☺'), 
       url('bumblebee-webfont.woff') format('woff'), 
       url('bumblebee-webfont.ttf') format('truetype'), 
       url('bumblebee-webfont.svg#webfontg8dbVmxj') format('svg');
}

I would like this because there are multiple name usages for the same font. it should be that text below has the same font:

<h2 style="font-family:'Cool font';">Hello</h2>
<h2 style="font-family:'New font';">Bye</h2>

Is this possible?

moffeltje
  • 4,521
  • 4
  • 33
  • 57
  • Not sure how okay it is to add this, but in one of the related posts, there was a question with a near identical scenario that got loads of support. [link](http://stackoverflow.com/q/2436749/4181953) If that answers your question, you might want to delete this one so there aren't multiples of the same question hanging around. – bonzo Aug 15 '16 at 12:51
  • @bonzo Thanks for your reply, your link adds some clarification, but though this question is slightly different. If it doesn't have a sufficient answer today I will delete it. – moffeltje Aug 15 '16 at 12:59
  • 1
    That's quite alright, I'd give it a little more time, I believe I just misinterpreted the similarities. There's a lot more people way more skilled than myself. So what's stopping you from using different classes? Like, a main class with the font (defaults) etc, and then others that modify it accordingly based off of context? – bonzo Aug 15 '16 at 13:05

1 Answers1

1

Yes, you can do this.

Because font-family is the key, and you can set many font face with different name and same Font, But it's not common to use it in this way!!