Css selector rule

Css selector rule
0

#1

I was taking this challenge where it asked me to import google fonts and use css selector to change the font of h2 element to lobster, the output shows the changed font but it still displays an error

Passed
Import the Lobster font.
Passed
Your h2 element should use the font Lobster.
//this is where i am wrong// Use an h2 CSS selector to change the font . //
Passed
Your p element should still use the font monospace.

<head>
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text
  {
    color:red;
    font-family:Lobster,courier;
  }
p
{
    font-size: 16px;
    font-family: monospace;
  }
</style>
</head>
<h2 class="red-text">CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>

#2

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#3

I didn’t know that …thank you!


#4

So you need to put this on your h2 directly…similar to the p tag:

h2 {
font-family: Lobster, Courier;
}