How do i remedy this You should only use an h2 element selector to change the font

<link rel="stylesheet"

          href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

    <style>

    h2 {

        font-family: 'Lobster', serif;

        font-size: 16px;

      }

  .red-text {

    color: red;

  }

  p {

    font-size: 16px;

    font-family: monospace;

  }

</style>

<h2 class="red-text">CatPhotoApp</h2> 

where am i going wrong ? and also why is it that i dont have to put a . infront of h2 ?

Hi @allnesscomplex,
for next time use the Preformatted text option, it’ll be easier to help you, and don’t forget to link the challenge you face, I had to look for it to understand the problem.

For the challenge there are some mistakes:

  1. In your <link> tag you have rel='stylesheet' twice, remove one and comment out the link element.
  2. In h2 style rules, remove font-size and in font-family replace serif with monospace.

For the rest don’t forget, follow the instructions:

To begin, apply the monospace font to the h2 element, so that it now has two fonts - Lobster and monospace .

In the last challenge, you imported the Lobster font using the link tag. Now comment out that import of the Lobster font (using the HTML comments you learned before) from Google Fonts so that it isn’t available anymore. Notice how your h2 element degrades to the monospace font.

Note: If you have the Lobster font installed on your computer, you won’t see the degradation because your browser is able to find the font.

:wave:

1 Like

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.