Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
In our previous videos, we learned to add new web fonts to our web page, and that’s a big help. But web type has other properties that we haven’t examined yet that we could use to improve the presentation of our Lake Tahoe project.
Font shorthand solution
Here's how I solved the problem of providing a shorthand for our h1
and h2
selectors.
OLD CODE
h1, h2 {
font-family: 'Abolition Regular', Impact, Charcoal, sans-serif;
font-weight: normal;
line-height: 1.1;
}
h1 {
font-size: 4rem;
}
h2 {
font-size: 2.5rem;
}
NEW CODE
h1, h2 {
font: 400 4rem/1.1 'Abolition Regular', Impact, Charcoal, sans-serif;
}
h2 {
font-size: 2.5rem;
}
Here I've declared both the h1
and h2
at once using a single, comma-separated selector, then changed the size of the h2
beneath our first rule.
If you've found another solution that works, great job! Most coding challenges have more than one effective solution.
Further reading
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up