ricsi114
ricsi114

Reputation: 35

How can I select a class in a class in css?

Here's the pic

So what I'm trying to do is that I want to give The Business Man and The Lamplighter border individually.

Since both are in a container I figured I can just use .container.asteroid but it's not working.

Anyone got an answer to this?

Upvotes: 0

Views: 49

Answers (1)

shotgun02
shotgun02

Reputation: 784

You need to put space between the two class names.

.container .asteroid{

}

Here's how to give style to specific .asteroid class in your html.

.container .asteroid{
    border:green solid 1px;
}

.container .asteroid.big{
    border:red solid 1px;
}

Upvotes: 3

Related Questions