This is some plain ol' text, in a paragraph.
This is a paragraph with emphasized or italic content.
This is a paragraph with some strong content.
This is a paragraph with both strong and emphasized text TOGETHER!!!!
Sometimes, as with embedding movies and audio, it is easier and more efficient to utilize a service that will deliver the fonts via their servers.
This type of service will allow you to not worry about font-package types. As the service will often query the browser and deliver the appropriate type. Additionally, this means that you do not have to manage the fonts on your server space.
Google Fonts, in addition to allowing for font downloads, also provides a font server service.
There are embed links from the same pop-up window that allows you to download a font-package. Simply copy the HTML or CSS embed code from their site into the appropriate place. Then specify the font in CSS rules.
As an example, lets do the same thing as the previous page, but instead, use Google’s embed code.
To do this, we will pick up after step 4.
NOTE: Make sure you have still selected a font, and gone into the CUSTOMIZE tag to select any additional font styles you may need.
Please refer back to the “Example with Google Fonts” area of the previous page.
Instead of downloading the fonts, select the “EMBED” tag next to “CUSTOMIZE”.
Then depending on whether you want to include the embed code in your HTML OR CSS, select the “STANDARD” tag OR “@IMPORT” tag.
Then copy the code below in the gray box.
This would go in the <head>
element of index.html
:
<link href="https://fonts.googleapis.com/css?family=Arvo:400,400i,700,700i" rel="stylesheet">
This could be placed either in:
style.css
file.index.html
file inside a <style>...</style>
element.NOTE: Where ever you place it, you must make sure it appears before you try to assign the font.
If we placed this in our css file, it would appear at the top like:
@import url('https://fonts.googleapis.com/css?family=Arvo:400,400i,700,700i');
At this point, the font is ready for use. We could pick up from step 10 on the previous page.
To accomplish the same thing as the previous page, our final code would look like the following:
NOTE: We are using the "HTML link" method from Google fonts for embedding the font code. As such, this is placed in our HTML. It does not usally need an additional CSS "fonts" file.
This is some plain ol' text, in a paragraph.
This is a paragraph with emphasized or italic content.
This is a paragraph with some strong content.
This is a paragraph with both strong and emphasized text TOGETHER!!!!
style.css
and index.html
set-up. Was this easier?