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 do I get multiple fonts in one page?

I want my header, witch says Sara Parker, in one font and the text under and the rest to be some other font. Also in different font-sizes. Can someone please explain to me how to do this?

My code: https://w.trhou.se/45hpcvkpqw

2 Answers

in your main.css files

https://developer.mozilla.org/en-US/docs/Web/CSS/font-family

your would add the the font name and size there

h1 {
// Pick a new font-family
  font-family: 'Lato', sans-serif;
  margin: 15px 0;

//font size
  font-size: 1.75em;
  font-weight: normal;
  line-height: 3.8em;
}

Thanks! Do you also know how I get the small text under "Sara Parker" to get bigger?

A couple different ways to do that it's look for the <tag> that you like to change.

https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity#Selector_Types

The details in the spec are actually reasonably readable. In summary:

!important rules and inline style rules win most.

Otherwise, normally the more specific wins. #id is a more specific selector than .classname is a more specific selector than tagname.

Where rules are equally specific, the one declared last wins