Marina Nelson
Marina Nelson

Reputation: 21

How to have two H4 tags using different colors

I am using the following style:

h4 {
  color: #ffffff;
}

h4 .name {
color: #cf3046;
}

I am using the following html

<h4 class="name">NAME</h4>

NAME is not changing color to #cf3046 but remains white. What am I doing wrong?

Thank you.

Upvotes: 2

Views: 7978

Answers (1)

dezman
dezman

Reputation: 19358

h4.name {
    color: #cf3046;
}

There should be no space between h4 and .name, because they refer to the same element.

Upvotes: 4

Related Questions