Is it possible to have one css class having a property which calls another CSS class?
Example:
.redcolor {
color:red;
}
p {
text-align: center;
color: redcolor;
}
Is it possible to have one css class having a property which calls another CSS class?
Example:
.redcolor {
color:red;
}
p {
text-align: center;
color: redcolor;
}
No unless you are using SASS/LESS. You are stuck with giving everything "Red" as a normal class.
No ! It is not possible in plain CSS but you can always use Some CSS Preprocessors like SASS or LESS
New Edit: Okay I was searching about it and seems your problem can be solved without using pre Preocessor have a look here
but, let me clear this is experimental as per MDN can may not be compatible in all browsers