# Background color css

**URL:** <https://forum.freecodecamp.org/t/background-color-css/477621>\
**Category:** I Built This\
**Created:** [September 13, 2021, 1:34pm UTC](https://forum.freecodecamp.org/t/background-color-css/477621 "2021-09-13T13:34:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vickvysz](https://avatars.discourse-cdn.com/v4/letter/v/9de0a6/32.png) [@Vickvysz](https://forum.freecodecamp.org/u/Vickvysz)\
**Post date:** [September 13, 2021, 1:34pm UTC](https://forum.freecodecamp.org/t/background-color-css/477621/1 "2021-09-13T13:34:18Z")

</div>

Can anyone tell me what the problem here is. I want a silver background

```auto
      .silver-background {
        background-color: silver;
    }
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>
<main>
  <p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>

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

  <div class="silver-background" attribute background-color: silver;>

```

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [September 13, 2021, 1:35pm UTC](https://forum.freecodecamp.org/t/background-color-css/477621/2 "2021-09-13T13:35:23Z")

</div>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [September 13, 2021, 1:36pm UTC](https://forum.freecodecamp.org/t/background-color-css/477621/3 "2021-09-13T13:36:05Z")

</div>

It would help if we knew what challenge you were on.

Please provide a challenge link.

Also, this is a syntax error

> [@Vickvysz](#):
>
> ```auto
> <div class="silver-background" attribute background-color: silver;>
> 
> ```

---

<div class="post-metadata">

**Author:** ![Vickvysz](https://avatars.discourse-cdn.com/v4/letter/v/9de0a6/32.png) [@Vickvysz](https://forum.freecodecamp.org/u/Vickvysz)\
**Post date:** [September 13, 2021, 1:37pm UTC](https://forum.freecodecamp.org/t/background-color-css/477621/4 "2021-09-13T13:37:59Z")

</div>

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/responsive-web-design/basic-css/give-a-background-color-to-a-div-element)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [September 13, 2021, 1:40pm UTC](https://forum.freecodecamp.org/t/background-color-css/477621/5 "2021-09-13T13:40:58Z")

</div>

The challenge wants you to add the class of silver-background to the div.

This part is correct

> [@Vickvysz](#):
>
> ` <div class="silver-background"`

but then you added all of this extra stuff which is incorrect.  
You need to delete it.

> [@Vickvysz](#):
>
> `attribute background-color: silver;`

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [March 15, 2022, 1:41am UTC](https://forum.freecodecamp.org/t/background-color-css/477621/6 "2022-03-15T01:41:28Z")

</div>

Closed on March 15, 2022, 1:41am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
