Home >>

How to request multiple Google Font API families in a CSS Style


In ordinary text you can change how Google Font API looks by using CSS Style.
Example in HTML format:
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Lobster">
<style>
body {
font-family: 'Lobster', serif;
font-size: 48px;
}
</style>
</head>
<body>
<h1>Lobster goes here!</h1>
</body>
</html>
If you open this HTML file in a modern web browser, you should see a page displaying the following preview, in the font called Lobster:
Lobster goes here!


That's an example of ordinary text in a kind of Google Font API.
But now, how to display text in multiple kind of Google font API in one page?

Requesting multiple fonts allows you to use all of Google fonts in your page. To request multiple font families in a CSS style can be done by separating the names with a pipe character (|) and replace any spaces in the font family name with plus signs (+).

Example, if you want to request the fonts Neucha, Cuprum, and Reenie Beanie, you should separate the fonts with a pipe character (|) like this, on <Head> section:
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Neucha|Cuprum|Reenie+Beanie">

On <body> section:
Here are <span style="font-family: 'Neucha',serif; font-size: 24px;">Neucha</span>, <span style="font-family: 'Cuprum',serif; font-size: 24px;">Cuprum</span>, <span style="font-family: 'Reenie Beanie',serif; font-size: 24px;">Reenie Beanie</span>

That codes will look like:
Here are Neucha, Cuprum, Reenie Beanie