Home arrow HTML arrow Page 3 - Using the Google Font API`s Italic Option with Multiple Fonts
HTML

Using the Google Font API`s Italic Option with Multiple Fonts


In this third part of the series you will learn how to use the Google Font API for embedding into a web page the italicized versions of two different font families. The entire process is very simple, thanks to the flexibility offered by the API’s “italic” query string argument.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
June 21, 2010
TABLE OF CONTENTS:
  1. · Using the Google Font API`s Italic Option with Multiple Fonts
  2. · Review: using the italic argument of the Google Font API
  3. · Using the italic option with multiple font families
  4. · Binding the CSS styles to an (X)HTML document

print this article
SEARCH DEVARTICLES

Using the Google Font API`s Italic Option with Multiple Fonts - Using the italic option with multiple font families
(Page 3 of 4 )

As I stated in the section that you just read, the Google Font API makes it really easy to download and use only the italic versions of multiple font families. In fact, you already saw how to achieve this using a single typeface; nevertheless, it'd be useful to go one step further and demonstrate how to do the same thing with two font families at the same time, at least for didactic purposes.

So here's the HTML code required for performing the aforementioned task: 

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Cantarell:italic|Nobile:italic" />

As you can see above, downloading the "Cantarell" and "Nobile" fonts in their italic versions is an approachable process that speaks for itself. Obviously, the procedure is as simple as appending the "italic" argument to the name of each font being downloaded, separated by a colon (:). It's that easy.

Once the corresponding fonts are available in the client machine, using them to decorate a few text-based HTML elements is literally identical to the examples that you learned before. The following code snippet shows this in a nutshell: 

h1 {

    font: normal 46px 'Cantarell', Helvetica, sans-serif;

    color: #00f;  

}

h2 {

    font: normal 40px 'Cantarell', Helvetica, sans-serif;

    color: #ff8040;  

}

h3 {

    font: normal 32px 'Cantarell', Helvetica, sans-serif;

    color: #ff8040;

}

p {

    font: normal 14px 'Nobile', Helvetica, serif;

}

So far, so good. Now that you know how to use the "italic" option with at least two different font families, it's time to see if the CSS styles coded above really work as one might expect. In the next section I'm going to include those styles into a web page. This will provide you with a complete example which you'll be able to tweak and customize according to your personal preferences.

Now, to see how this example will be defined, jump forward and read the next few lines.


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials