I'm a newbie to CSS and I'm wondering if there is a way to implement
inheritance in a way similar to C++/Java?
ie:
if I have a class:
div.parent { padding: 0px; margin: 0px }
and I want to derive a subclass which inherits the parent class's
properties
but can also override some:
div.child extends div.parent { padding: 10px; /* padding property
overriden,
and margin property inherited */ }
I know this is not a CSS syntax, but is there a way to implement
something like this in CSS?
Thank You.
inheritance in a way similar to C++/Java?
ie:
if I have a class:
div.parent { padding: 0px; margin: 0px }
and I want to derive a subclass which inherits the parent class's
properties
but can also override some:
div.child extends div.parent { padding: 10px; /* padding property
overriden,
and margin property inherited */ }
I know this is not a CSS syntax, but is there a way to implement
something like this in CSS?
Thank You.
Comment