Question:
Is it possible to make a CSS class that "inherits" from another CSS class (or more than one).
For example:
.test { width:200px;display:block }
.logo { background:#cc;border:1px solid #4d4d4d }
I'd like to do is something like this:
.combine
{
.test;
.logo
}
where the ".combine" class would use all the attributes like width 200px, display block, background color #ccc and border color.
Answer:
Good Question my friend. But i think you can't do something like that. It would be much helpful for a developer if this is possible! Instead you can use multiple classes to a single block element.
For Example:
<div class="test logo ">text text text</div>
I heard that there is a tool called lesscss which iam not sure whether it will work in all the browsers. That tool might solve your problem, but do check for browser compatibility.
Aucun commentaire:
Enregistrer un commentaire