{"id":874,"date":"2015-01-07T06:53:16","date_gmt":"2015-01-07T12:53:16","guid":{"rendered":"http:\/\/cssnewbie.com\/?p=874"},"modified":"2015-01-07T06:53:16","modified_gmt":"2015-01-07T12:53:16","slug":"how-to-use-google-fonts-with-css-tutorial","status":"publish","type":"post","link":"https:\/\/cssdeck.com\/blog\/how-to-use-google-fonts-with-css-tutorial\/","title":{"rendered":"How to use Google Fonts with CSS Tutorial"},"content":{"rendered":"<p>Googles fonts API &#8220;makes it quick and easy for everyone to use web fonts&#8221; and is very simple to use. There are many advantages to using Google fonts because you get to use elegant fonts on your website that have been tested on hundreds of browser configurations and googles content delivery system can reassure you that users will always be able to load the fonts. <\/p>\n<p>There&#8217;s essentially 2 steps to integrating a Google font into your website. First you include the stylesheet then you assign the font to the elements on your page that you want to use it, and that&#8217;s it! There are two more options you can customize to fit your needs if you want additional font styles or character sets.  <\/p>\n<p>After you&#8217;ve found a font you like from <a href=\"http:\/\/google.com\/fonts\">Google Fonts<\/a> and clicked the quick use button you&#8217;ll see 4 options. The first is where you choose your styles, which usually include light, normal, bold, and super bold options. Next you&#8217;ll choose your character sets such as latin, greek, and vietnamese. The third step is where you copy the code to include the font on your page. Google gives three options on including the font.<\/p>\n<p>The standard option is your traditional &lt;link&gt; tag that you include in your &lt;head&gt; tag.<\/p>\n<pre>&lt;link href='http:\/\/fonts.googleapis.com\/css?family=Open+Sans' rel='stylesheet' type='text\/css'&gt;<\/pre>\n<p>The @import option allows you to include the single line in another CSS document that is already included in the &lt;head&gt; of your website. <\/p>\n<p>Finally the Javascript option allows you to include the styling through a javascript function.<\/p>\n<p>The last step is assigning the font families to elements on your page. Assign the font using the font-family tag and the name of the font you selected, just like any other font. Make sure to include a fallback font just to be safe!<\/p>\n<pre>font-family: 'Open Sans', sans-serif;<\/pre>\n<div class=\"wp-socializer wpsr-share-icons \" data-lg-action=\"show\" data-sm-action=\"show\" data-sm-width=\"768\" ><h3>Share and Enjoy !<\/h3><div class=\"wpsr-si-inner\"><div class=\"wpsr-counter wpsrc-sz-32px\" style=\"color:#000\"><span class=\"scount\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook,twitter,linkedin,pinterest,print,pdf\">0<\/span><\/span><small class=\"stext\">Shares<\/small><\/div><div class=\"socializer sr-popup sr-32px sr-circle sr-opacity sr-pad sr-count-1 sr-count-1\"><span class=\"sr-facebook\"><a rel=\"nofollow\" href=\"https:\/\/www.facebook.com\/share.php?u=\" target=\"_blank\"  title=\"Share this on Facebook\"  style=\"color: #ffffff\" ><i class=\"fab fa-facebook-f\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-twitter\"><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/intent\/tweet?text=%20-%20%20\" target=\"_blank\"  title=\"Tweet this !\"  style=\"color: #ffffff\" ><i class=\"fab fa-twitter\"><\/i><\/a><\/span>\n<span class=\"sr-linkedin\"><a rel=\"nofollow\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=\" target=\"_blank\"  title=\"Add this to LinkedIn\"  style=\"color: #ffffff\" ><i class=\"fab fa-linkedin-in\"><\/i><\/a><\/span>\n<span class=\"sr-pinterest\"><a rel=\"nofollow\" href=\"https:\/\/www.pinterest.com\/pin\/create\/button\/?url=&amp;media=&amp;description=\" target=\"_blank\"  title=\"Submit this to Pinterest\"  style=\"color: #ffffff\" data-pin-custom=\"true\"><i class=\"fab fa-pinterest\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"pinterest\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-print\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Print this article \"  style=\"color: #ffffff\" ><i class=\"fa fa-print\"><\/i><\/a><\/span>\n<span class=\"sr-pdf\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Convert to PDF\"  style=\"color: #ffffff\" ><i class=\"fa fa-file-pdf\"><\/i><\/a><\/span><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Googles fonts API &#8220;makes it quick and easy for everyone to use web fonts&#8221; and is very simple to use. There are many advantages to using Google fonts because you get to use elegant fonts on your website that have [&#8230;]<\/p>\n<p><a class=\"more-link article\" href=\"https:\/\/cssdeck.com\/blog\/how-to-use-google-fonts-with-css-tutorial\/\" title=\"Click to read 'How to use Google Fonts with CSS Tutorial'\">Read Article<\/a><\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[192],"tags":[],"_links":{"self":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/874"}],"collection":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/comments?post=874"}],"version-history":[{"count":0,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/874\/revisions"}],"wp:attachment":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media?parent=874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/categories?post=874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/tags?post=874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}