Trouble with class selectors

css
html
#1

So i’m trying to create a class tag for a html property. Heres what I have so far.

html
(screen cap was the what i figured id use to show my html because it dissapears when i actually post it here. What do?)

And here is my CSS
(Note: I’m using ATOM as my editor, and when i type .monkey it doesn’t “link”, or turn green)

.monkey {
padding: 10px;
background-color: darkgreen;
align-self: center;
}

#2

Alexander: This may not help for this problem, but I wanted to pass it along.

I found this table to be a helpful resource with CSS Class Selectors:

https://www.w3schools.com/cssref/css_selectors.asp

Eric

#3

The CSS looks fine to me (for whatever that’s worth).

Have you tried something other than center?

I was doing some checking on the Mozilla site and found this -

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

So that makes me wonder if it’s the html tag instead of the css; or if maybe the css won’t attach properly to it.

Maybe using a div, and adding centering within the .monkey css?

#4

@alexanderponce-885

Yes, I don’t believe <center> and <p1> tags are valid HTML5 elements. Try using <div> and <p> instead.

You can put code between tick marks ``` ``` (left of the 1 key) like this to have it show as code. You can even tell it what kind of code it is after the first three tick marks for syntax highlighting!

```css
.monkey {
  padding: 10px;
  background-color: darkgreen;
  align-self: center;
}
```

turns into

.monkey {
  padding: 10px;
  background-color: darkgreen;
  align-self: center;
}
#5

Thanks guys! I’ve since changed the tag, as for the selector not working i switched to a div and it worked! As for the ATOM thing, I learned that it won’t go “green” but it still works lol. It’s cause i was trying to use i think that it didn’t work.

#6

Try using a hex value like #006400