Israel Rodriguez
Israel Rodriguez

Reputation: 209

CSS style sheet class

Is there a way you can have a CSS file with one class let say p.one{color:red;}

and apply it to different tags? is there a way i can get an example if this is possible?

Upvotes: 0

Views: 56

Answers (2)

Salil
Salil

Reputation: 47482

Create a class with color name that will be easy to use.

.redText { color: red; }

Upvotes: 0

Quentin
Quentin

Reputation: 943510

with one class

That isn't a class. It is a rule-set with a selector consisting of a type selector and a class selector.

and apply it to different tags?

Don't specify the element type. Use a class selector by itself.

.one { color: red; }

Upvotes: 5

Related Questions