Setting colors using the rgb function

Tell us what’s happening:
This challenge says to set the red, green and blue colors in the rgb function of the .container class to max value of 255 but it doesn’t seem to work when I do that. Is there something I’m missing?

  **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Colored Markers</title>
  <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
  <h1>CSS Color Markers</h1>
  <div class="container">
    <div class="marker one">
    </div>
    <div class="marker two">
    </div>
    <div class="marker three">
    </div>
  </div>
</body>
</html>
/* file: styles.css */
h1 {
text-align: center;
}

.container {
background-color: rgb(255, 255, 255);
padding: 10px 0;
}

.marker {
width: 200px;
height: 25px;
margin: 10px auto;
}

.one {
background-color: rgb(255, 0, 0);
}

.two {
background-color: rgb(0, 255, 0);
}

.three {
background-color: rgb(0, 0, 255);
}

  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36

Challenge: Step 27

Link to the challenge:

This will sound dumb but I ran into a similar issue on a later course that was giving me that issue. The code looks okay to me and works if I input it on mine. Erase the line of code and then ctrl+enter to make the problem give you an error, and then follow the steps entirely. Like put in background-color: but give nothing else, enter it, get the error. Then add rgb() without any context, enter it, get the error and then input the 255 per rgb. Or just try refreshing the page…

If that doesn’t work then that is above me lol. Maybe you have 1 too many ‘spaces’ inserted :joy:

1 Like

:joy: :joy: I tried refreshing and doing the same thing over and over again like a fool. I thought I was paranoid lol. I’ll keep trying though, thanks.

You could try inputting without the commas and see if it accepts it then. There was a step that I had to… either add or remove them, can’t remember which, but that was the issue.

.container {
  background-color: rgb(255 255 255);
  padding: 10px 0;
}

Literally the input I have lol.

lol it was the spaces … it worked. I’m pretty sure I tried it before but wheeew…

Your code is passing for me. Try restarting the step and do a hard refresh Shift + F5


Please ensure that you have disabled any extensions that interface with the freeCodeCamp website (such as Dark Mode and Ad Blocker), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

Seeing as you have passed other steps that sets colors I don’t think this is the case.

1 Like

removing the spaces seems to work now

I think that is just a coincidence as the test is not looking at the code but the computed color on the element.

Anyway, good that you fix it. Happy coding.

2 Likes

Yay hahahaha it is super finicky at times!

1 Like

Thank you both! I’m sure this is the least of problems I come across in future coding lol

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