<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family:Lobster, Helvetica;
}
p {
font-size: 16px;
font-family: monospace;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
So this assignment asks - Import the Lobster font to your web page. Then, use an element selector to set Lobster as the font-family for your h2 element - I thought that my code does exactly what was asked and indeed the h2 phrase - Cat Photo App - is rendered in the Lobster font. But apparently the assignment is incorrect due to this comment - You should only use an h2 element selector to change the font - huh? I thought my code does just that so what am I missing here?
I thought that when it came to specifying a font that you wanted to use, it was a good idea to list a second (which I have done with Helvetica) and third (which I have not done) choice. I guess I should have also specified a generic (serif, sans-serif, monospace) fallback but I forgot to do so.
The GENERIC_NAME is optional, and is a fallback font in case the other specified font is not available. This is covered in the next challenge.
Although this challenge tells you how to use a generic name in font-family, it doesn’t specify which one to use for Lobster, which is why your test is failing.
Aha ! (light bulb goes on!) So the point then is that, at least for the purposes of this excercise, we DON’T use a generic when using the
font-family attribute. We simply use h2 {font-family: Lobster;}
I passed the excercise finally, using this line of code but I think that I should have passed with
h2 {font-family: Lobster, Helvetica;}
as well since it did give the font output on the web page that was desired
Good job working through it.
The hard thing about programming isn’t that computers are smart, it’s that computers are stupid. They only do exactly what we tell them to and only if we tell them exactly the right way. This is why some of the tests will be overly specific when it comes to implementation; it’s just really difficult to write programmatic tests that behave logically.