Container class is not getting linked

Hey there and welcome to the forums! :wave: :slightly_smiling_face:

Probably gonna need some more context to help here. What lesson is this from? Could you post a link to it?

Could you also share your actual formatted code instead of a screenshot? It’s a lot easier to work with that way. You can share it formatted by pasting it between two lines of three backticks:
```
Your code here
```

1 Like

above is the link of stage where I am stuck. It is “Learn CSS colors by building a set of colored markers” stage of course.
Following is the code of index.html
‘’’

<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">
<h1>CSS Color Markers</h1>

<div class="container">

  <div class="marker one">

  </div>

  <div class="marker two">

  </div>

  <div class="marker three">

  </div>

</div>
'''

Following is the code of styles.css
‘’’
h1 {

text-align: center;

}

.
.container {

background-color: rgb(0, 0, 0);

}
.marker {

width: 200px;

height: 25px;

margin: 10px auto;

}

.one {

background-color: red;

}

.two {

background-color: green;

}

.three {

background-color: blue;

}
‘’’

Thanks! It looks like you used single quotes, ' instead of backticks `.
Not sure were you’re based but on most US keyboards a backtick is above the tab key and to the left of the 1 key.


Anyways, on to your code. It looks like you have an extra dot . on the line above you .container selector. Since CSS doesn’t read whitespace it sees it as being part of the selector, which is invalid, and therefor the selector isn’t rendered.

It really worked, thanks a lot. That extra dot was the problem. Thanks god I had to face this problem for better understanding of how this thing works.

1 Like

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