Color is not turning blue?

Color is not turning blue?
0.0 0

#1

Tell us what’s happening:

Your code so far


<style>
h2 {color: blue;} CatPhotoApp
</style>
<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>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>

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 6.0; Infinix_X521 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/use-css-selectors-to-style-elements


#2

Your CSS styling is targeting <h2> elements but your HTML doesn’t have any <h2> elements. You seem to have accidentally deleted the <h2> element that came before the <style> block in your code. The “CatPhotoApp” text in your code isn’t actually an HTML element, everything you put between <style> tags is read by the browser as CSS.


#3

I have reset the codes severally, it seems there’s something to be added that is not in the instructions


#4

@LiteralMetaphorical I have reset this severally there’s nothing more that I have deleted


#5

Delete the h2 style="color: red" part of the h2 tag that should be at the very top of the challenge. Leave the rest of the tag in-tact so you still have a header. Then you can make an h2 selector in the style tag to change the color!

Here’s the full h2 tag if it isn’t there and you want to copy and paste it to the first line:
<h2 style="color: red">CatPhotoApp</h2>


#6

That is correct @JoshuaRasberry But this is the instructions given " Delete your h2 element’s style attribute, and instead create a CSS style block. Add the necessary CSS to turn all h2 elements blue."


#7

h2’s style attribute is the first piece of code I outlined in the last reply. Just remove that and create a separate style tag instead, making sure to keep the rest of the h2 tag intact.


#8

Hi there, I runned your code and found your problem

First remove that ‘CatphotoApp’ word from the style tag
Now after the tag, create a h2 element,

and now inside it Type ‘CatPhotoApp’

Now your code will run
and the heading of CatPhotoApp will be blue, Try it


#9

Hi @JoshuaRasberry Thanks for your efforts but I already sorted it