question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use CSS Class to Style an Element - h2 is not red even though I have the other 3 requirements checked off.

See original GitHub issue

Use CSS Class to Style an Element - h2 is not red even though I have the other 3 requirements checked off.

Red X - Your h2 element should be red. Green Checkmark - Your h2 element should have the class red-text. Green Checkmark - Your stylesheet should declare a red-text class and have its color set to red. Green Checkmark - Do not use inline style declarations like style=“color: red” in you

Challenge Name - Use CSS Class to Style an Element

I’m using Chrome on an Android phone.

Here’s my code:

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

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

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

I have a programmer friend who entered exactly what I have entered in a computer and it was accepted and he got all green checkmarks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ImSerenityADevcommented, Aug 15, 2016

You need to replace h2 with .red-text currently you have both (drop the h2) h2 .red-text - For more, help room is good for stuff like this. Also, <br> shouldn’t be added to your code (unless that’s just some side effect of you posting from phone to issue)

0reactions
dipsikharaycommented, Aug 10, 2018
<style> .red-text { color: red ;} </style>

CatPhotoApp

<main>

Click here to view more cat photos.

A cute orange cat lying on its back.

<div>

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
</div> <form action="/submit-cat-photo"> <label> Indoor</label> <label> Outdoor</label>
<label> Loving</label> <label> Lazy</label> <label> Energetic</label>
<button type="submit">Submit</button> </form> </main>

declare class in style-sheet but I think my code is right still can’t run.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not working: Your h2 element should be red - HTML-CSS
code appears to work, style appears to be correctly applied, am told that H2 element should be red. all 3 other conditions are...
Read more >
Use a CSS Class to Style an Element - Snakify
Your h2 element should be red. Your h2 element should have the class red-text . Your stylesheet should declare a red-text class and...
Read more >
Cascade, specificity, and inheritance - Learn web development
The rule that's styling your element may not be the one you expect, ... When two rules from the same cascade layer apply...
Read more >
Can I write a CSS selector selecting elements NOT having a ...
I would like to write a selector that selects all elements that don't have the "printable" class which, in this case, are the...
Read more >
not - CSS-Tricks
Our CSS would select all the <li> elements except the one(s) with a class of .different . ... You could also do the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found