Class selectors are confusing

I’m stuck on the class selectors step. I think I’ve coded exactly what they said to, but obviously, I didn’t. How did I mess up?

‘’’
.class-menu {
width: 80%;
background-color: burlywood;
margin-left: auto;
margin-right: auto;
}
‘’’

  **Your browser information:**

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14588.98.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.59 Safari/537.36

Challenge: Step 27

Link to the challenge:

To give you an idea on how to target classes on elements:

<elem class="className"><elem/>

to target that class you would do it like this in your CSS:

.className {
  // input style here
}

In your case, you need to target an element with a class of menu, how would you do it?

Well, it says to code
.class-name {
style
}
Which, I think I did. I tried both ways you suggested, but neither work.

No, that was just an example.

Read this carefully:

The only thing that makes a selector a class selector is the dot . in front of the name. Adding class to the selector name has nothing to do with it.

menu is the name and a dot . in front of the name makes it a class selector.

Some class selectors:

.text-color
.btn
.alert

Thank you so much! That did it!

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