Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!