I recommend that the @import
be placed shortly after @charset "UTF-8";
.
Then you must specify the source path provided on Google Fonts, soon after the source will be installed and ready to use. Important to note that we have to use the specific name that the site provides to work properly. In my example, I used the source Titillium
for Google Web Fonts.Behold:
@charset "UTF-8";
@import url('https://fonts.googleapis.com/css?family=Titillium+Web');
h1 {
font-family: 'Titillium Web', sans-serif;
}
It is worth remembering that the @import
is an element CSS
, then it can get inside a tag <style>
in the head
of your 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, we also have the facility, without needing to download anything, just copying the path of the desired source that is already hosted on google servers and specifying your name in your file CSS
.
Refencia:
Have you checked whether the file is actually being tapped and cached free?
– Ricardo
your @import is the first line of your . css? Nothing before, not even comments ? If you can paste the beginning of your . css, it would be better
– woliveirajr
The way is really right?
– Jefferson Alison
@woliveirajr Putz guy was an ignorant now, there was a comment line before and did not know that it influenced changed the position and worked, grateful.
– HeltonSS
@Cool Heltonss that worked. I put the comment as an answer, so you can accept and it will be easier for future visitors to your question to know what was the answer that helped.
– woliveirajr