Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Customizing Colors and Fonts Pick Fonts and Set Relative Units

Font Not Changing

Hey all.

I have a conundrum regarding my Google font. Here it is in my index:

<head> <meta charset="utf-8"> <title>David Hynes | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.googleapis.com/css?family=Play:400,700' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> </head>

And CSS main:

h1 {font-family: 'Play', sans-serif; margin: 15px 0; font-size: 1.75em;}

Garrett Levine
Garrett Levine
20,305 Points

it's possible it could be an issue with the font/google fonts itself. I recommend changing to some basic fonts to see if it a code issue, or an external issue, and then we can move on from there!

Jacob Miller
Jacob Miller
12,466 Points

The Google font is working for me. Are you sure that you are linking to the main.css file correctly?

2 Answers

Here's what I tried and the H1 was in Play and the H2 was not. Make sure the href="" on the link rel="stylesheet" points to the .css file.

<head>
 <meta charset="utf-8">
  <title>David Hynes | Designer</title>
  <link rel="stylesheet" href="css/normalize.css">
  <link href='http://fonts.googleapis.com/css?family=Play:400,700' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="main.css">
</head>
<body>
  <h1>This is a test of the H1</h1>
  <h2>This is an H2</h2>
</body>
h1 {
  font-family: 'Play', sans-serif; 
  margin: 15px 0; 
  font-size: 1.75em;
}

Hey it worked tonight for some reason without me changing anything... very odd! Maybe Google was resetting those servers last night or something! Thanks for chiming in, everyone!