Use CSS Class to Style an Element - h2 is not red even though I have the other 3 requirements checked off.
See original GitHub issueUse 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:
- Created 7 years ago
- Comments:17 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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)CatPhotoApp
<main>Click here to view more cat photos.
<div>
Things cats love:
Top 3 things cats hate:
<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.