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.

Give Background Color to Div Element Not Accepting Correct Answer

See original GitHub issue

Challenge give-a-background-color-to-a-div-element has an issue. User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0. Please describe how to reproduce this issue, and include links to screenshots if possible.



<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
 .red-text {
   color: red;
 }

 h2 {
   font-family: Lobster, Monospace;
 }

 p {
   font-size: 16px;
   font-family: Monospace;
 }

 .thick-green-border {
   border-color: green;
   border-width: 10px;
   border-style: solid;
   border-radius: 50%;
 }

 .smaller-image {
   width: 100px;
 }

 .silver-background {
   background-color: silver;
 }

</style>

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

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back. " src="https://bit.ly/fcc-relaxing-cat"></a>

<div class="silver-background">
 <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>
 <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>
 <input type="text" placeholder="cat photo URL" required>
 <button type="submit">Submit</button>
</form>
     ```

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:26 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
alexiss23commented, Jan 17, 2017

right

You forgot to add one more step to this question. The last question states: “Your div element should have a silver background.” Apply
.silver-background { background-color: silver; } To the styles area in order to assign the class the Silver color.

1reaction
LukaszKolocommented, Sep 9, 2016

So thats a problem, that code is correct 😃 and the program says its not correct

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does background-color have no effect on this DIV?
Since the outer div only contains floated divs, it renders with 0 height. Either give it a height or set its overflow to...
Read more >
HTML Background Color Tutorial – How to Change a Div ...
One of the most common things you may have to do as a web developer is to change the background-color of an HTML...
Read more >
<color> - CSS: Cascading Style Sheets - MDN Web Docs
The currentcolor keyword represents the value of an element's color property. This lets you use the color value on properties that do not...
Read more >
The "Inside" Problem - CSS-Tricks
There is no law that the background-color needs to come from one single continuous element. You could always “fake” the left and right...
Read more >
HTML: How To Change Background Color of a <div> element ...
Somewhere in <head> tag include <style> tags and type your CSS commands between them. In this case background:black will be applied to all...
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