First time writing code

First time writing code
0

#1

I am an old fart trying to learn how to write code at 56. I started with the HTML/CSS course and I am stuck on one of the first problems in Basic CSS: Style Multiple Elements with a CSS Class.

The challenge was “Classes allow you to use the same CSS styles on multiple HTML elements. You can see this by applying your red-text class to the first p element.”

I wrote what is below but it is not correct according to the “run test” function. Can someone please help? Remember I am brain dead.

<style>
  .red-text {
    color: red;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>
<main>
  <p>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 class="red-text">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>
  
  <form action="/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
    <label><input type="checkbox" name="personality" checked> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Energetic</label><br>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>```

#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

Thank you very much for the help. I am struggling but I need to learn how to code.


#4

Are you by any chance using Edge, IE, or Safari as your browser?


#5

Yes Safari I’m on a Mac


#6

I strongly suggest switching to Chrome.

Free Code Camp has bee updated to use newer technologies. It makes the application much faster and it means that we can go much longer without having to do a huge migration like this. However, Edge, Internet Explorer, and Safari are very bad about choosing not to adhere to standards and support new functionality in JS and CSS. Right now, that means that these browsers exhibit lots of unexpected behavior. If you become a web developer you will come to hate these browsers with every fiber of your being.


#7

Hahahaha! Ok I will switch to using Chrome then.


#8

Ok I’m using Chrome and my code still doesn’t satisfy the test checker? I have no way to advance since I can’t find the answer
Please help.


#9

you should put class = red-text in the first p


#10

You may please share the challenge link dear? So we would know what does challenge want, to help you better. Thanks.


#11

I did the same thing, I put the “red-text” in the second

instead of the first

.

Click here to view more cat photos.

” was hiding in plain sight.