Home arrow HTML arrow Page 3 - Displaying Bold Text with the Google Font API`s b Shorthand
HTML

Displaying Bold Text with the Google Font API`s b Shorthand


In this sixth part of the series, you will learn how to work with the “b” shorthand offered by the Google Font API, which can be used as a quick replacement for the “bold” option discussed in a previous part. The shorthand offers nothing especially difficult to grasp, so you shouldn’t have any problem using it when embedding bold fonts in your own (X)HTML documents.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
June 28, 2010
TABLE OF CONTENTS:
  1. · Displaying Bold Text with the Google Font API`s b Shorthand
  2. · Review: the i shorthand
  3. · Introducing the b shorthand
  4. · Including the CSS styles in an (X)HTML document

print this article
SEARCH DEVARTICLES

Displaying Bold Text with the Google Font API`s b Shorthand - Introducing the b shorthand
(Page 3 of 4 )

To be frank, the use of the “b” shorthand is very similar to its cousin “i” discussed in a previous installment of the series. So, say that you want to download the bold style of the “Cantarell” font family using the “b” option. In a case like this, the Google Font API should be queried as shown below:

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

There you have it. As you can see, the URL used to invoke the API offers nothing especially difficult to understand, as its syntax is nearly the same to the one used with other, previous examples. Once the requested fonts have been successfully transferred to the client computer, they can be used in a standard fashion:

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;

}

Considering that coding CSS styles like the ones shown above is something that you’ve probably done hundreds of times before, I’m not going to spend more time discussing how they work. Now we need to include the styles in a web page, so you can have at hand a working example that shows how to use the “b” shorthand.

That’s exactly what I plan to do in the last segment of this tutorial, so jump forward and read the lines to come.


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