I recommend that @import
be placed soon after @charset "UTF-8";
.
Then you must specify the source path provided in Google Fonts , shortly after the font is installed and ready to be used. It is important to note that we have to use the specific name that the site provides to function correctly. In my example, I used the Titillium
source by Google Web Fonts . See:
@charset "UTF-8";
@import url('https://fonts.googleapis.com/css?family=Titillium+Web');
h1 {
font-family: 'Titillium Web', sans-serif;
}
Note that @import
is a CSS
element, so it can stay within a <style>
tag in head
of its HTML
. In this example I used the source Dancing Script
for Google Fonts , the code looks like this:
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=Dancing+Script);
</style>
Note: In addition to the security of using Google Web Fonts sources, we also have the facility, without having to download anything, just by copying the path of the desired source that is already hosted on google servers and specifying your name in your CSS
file.
Refresh: