Learn CSS Colors by Building a Set of Colored Markers - Step 25

Tell us what’s happening:

Este paso logre resolverlo, pero creo esta publicacion para que alguien me explicque porque con “padding” no se separa con " , " como en el “background”, esa es la parte que no logro entender, si alguien me lo explica, seria genial.

Muchisimas gracias de antemano a la ayuda.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Colored Markers</title>
    <link rel="stylesheet" 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;
}


/* User Editable Region */

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

/* User Editable Region */


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

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

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

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36

Challenge Information:

Learn CSS Colors by Building a Set of Colored Markers - Step 25

1 Like

hi there!

your code is working from my end. reset the challenge step, clear your browser cache or change the browser and try again.

Hello @dskicia230 !

Like you, I am learning the process.

Your question about why the colors are separated by commas, but the padding values are not is a very good question.

I have not found the answer doing my online search yet.

Maybe somebody more experienced will answer your question for both of us.

Keep up the good progress! :slightly_smiling_face:

1 Like

Si, se que el codigo funciona, ya pase este paso, pero la pregunta real es:
¿ Por que para “padding” no se usa " , " para separar el 10px, 0 como en “backgroundo-color”

I have learned the reason is because the background color is a function.
The padding is not a function, so its values do not require the comma.

Hope this helps!

Keep up the good progress! :slightly_smiling_face:

3 Likes

Ok, entonces es para que se diferencie la codificación entre “background-color” y “padding” si se llega a usar en un mismo bloque, eso es lo que entendí.

1 Like

@Created-Unique is right. background-color value rgb() is a function. Within the function, we need commas to separate values.

1 Like