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

HTML How to Make a Website Customizing Colors and Fonts Add Fonts

Fonts added but header is now left aligned

Hi, I've added the Google fonts but the header is now left aligned. HTML

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Christy Small | Champion</title> <link rel="stylesheet" href="css/normalize.css"> <link href='https://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400italic,700,700italic,800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css">

</head> <body> <header> <a href="index.html" id="logo"> <h1>Christy Small</h1> <h2>Champion</h2> </a> <nav> <ul> <li><a href="index.html" class="selected">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul>

CSS

/****************************************** HEADING *******************************************/

logo {

text-align: center; margin: 0; }

h1 { font-family: 'Changa One', 'sans-serif'; margin: 15px 0; font-size: 1.75em; font-weight: normal; line-height: 0.8em; }

h2 { font-size: 0.75em; margin: -5px 0 0; font-weight: normal; }

2 Answers

Konrad Pilch
Konrad Pilch
2,435 Points

YOu need to put it in head.

Try this

<!-- Head -->
<head>
  <meta charset="utf-8">
<title>Christy Small | Champion</title>
<link rel="stylesheet" href="css/normalize.css">
<link href='https://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400italic,700,700italic,800' rel='stylesheet' type='text/css'>
 <link rel="stylesheet" href="css/main.css">
</head>

<!-- Header -->
<header>
  <a href="index.html" id="logo"> 
    <h1>Christy Small</h1>
    <h2>Champion</h2>
  </a>
  <nav>
    <ul>
      <li><a href="index.html" class="selected">Portfolio</a></li>
      <li><a href="about.html">About</a></li>
      <li><a href="contact.html">Contact</a></li>
    </ul>

thanks for your response. I cant see any difference between your code and mine. What do I need to add to the head? It looks like a CSS issue to me but I cant see anything

Seth Reece
Seth Reece
32,867 Points

Are you missing the # in front of logo in your css file to denote that logo is an id?

thanks for your reply, the # is in the code but it wont show in the example above.