Home arrow HTML arrow Page 3 - Using the Google Font API`s Bold Argument
HTML

Using the Google Font API`s Bold Argument


In this fifth part of the series, we examine the “bold” argument provided by Google’s Font API. It's used for requesting and downloading the bold style of a specified font family. As with the “italic” option discussed in earlier parts, you should use “bold” on web pages with due caution and responsibility (or in other words, don’t commit the cardinal sin of displaying all your HTML elements in bold!).

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
June 23, 2010
TABLE OF CONTENTS:
  1. · Using the Google Font API`s Bold Argument
  2. · Review: using the i shorthand for italics
  3. · Introducing the bold option
  4. · Including the CSS styles in a web page

print this article
SEARCH DEVARTICLES

Using the Google Font API`s Bold Argument - Introducing the bold option
(Page 3 of 4 )

In reality, using the "bold" argument to download the bold style of a specified font family is very similar to working with its cousin "italic." The entire process is limited to passing in the query string the name of the requested font followed by the keyword "bold," separated by a colon (:).

For you to understand more clearly how to use this option, I'm going to modify the web page shown in the previous segment, which in this case will request the bold version of the "Cantarell" font. To accomplish this, the Font API should be queried in the following way: 

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

There you have it. A request made like this will effectively download simultaneously the bold style of "Cantarell" and the regular version of "Nobile." With the typefaces already residing comfortably in the client machine, using them to decorate the H1, H2, H3 elements and and paragraphs of an (X)HTML document is as simple as coding the same CSS styles that you saw in the previous section. Here they are, in case you don't recall how they look:

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;

}

Since the above CSS code speaks for itself, I'm not going to explain how it works. Instead, it's time to see if the code really yields the expected results when included in a web page.

This will be accomplished in the upcoming section. To get there, click on the link that appears below and keep reading.  


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