I was just wondering if it's possible to add two links to Google Fonts in one import, so I'd be able to achieve have less lines of code and smaller CSS files in general.
Asked
Active
Viewed 54 times
1 Answers
1
The closest to accomplishing this that I am aware of is @import. You can read more about it here: https://www.w3.org/TR/CSS2/cascade.html#at-import
However, for general use it is recommended that you simply include multiple <link>
tags. See: Best way to include CSS? Why use @import?
The reason it isn't a regular thing is due to the nature of CSS being "cascading". You can't really place two stylesheets on the same "level" per se.
If you're getting fed up because of how large your header is, you can always create a universal file with PHP include. http://www.w3schools.com/php/php_includes.asp It can be irritating though as you cannot view the html file locally, it must reside on a server running PHP.

Jacob Colvin
- 2,625
- 1
- 17
- 36
-
Thanks for advice - I have a question though. Why would placing two stylesheets (that are only font stylesheets) on the same level wrong? Does linking them the usual way make any difference? – macbem May 11 '16 at 07:00
-
It's really exactly the same as any other CSS class. It's not "wrong", but it's less efficient. Really just depends on your use-case I suppose. – Jacob Colvin May 12 '16 at 00:12