1

I'm a newbie, and I spent a lot to find answer but I think I didn't search correctly.

How do I write this in one line?

.black h1 {
   color: #ffffff !important;
}
.black h2 {
   color: #ffffff !important;
}
.black h3 {
   color: #ffffff !important;
}
.black p {
   color: #ffffff !important;
}

Thanks In advance

3 Answers 3

2
.black h1, .black h2, .black h3, .black p {
   color: #fff !important;
}
Sign up to request clarification or add additional context in comments.

Comments

1

If you want specify only these elements

.black h1, .black h2, .black h3, .black p { color: #fff; !important; }

But if you want all elements inside this class

.black * { color: #fff !important; }

Comments

1

By a coma:

.black h1, .black h2, .black h3, .black p {
   color: #ffffff !important;
}

4 Comments

Hey newbie! Don't forget to accept the answer it can help other newbies :)
As you can see here, your code doesn't work as it selects all h2, h3 and p and not all h2, h3 and p inside a .black
Of course you're right I didn't bay attention, I forgot to copy past the black class. Newbie! don't forget it also :)
Thanks a lot! I really appreciate your help! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.