Jump to content

class inheritance


jordanwb

Recommended Posts

No. But you can name multiple selectors in one call. For example if you have:

 

.classA
{
   // some stuff
}

 

And you want classB to inherit the selectors from classA, you just add classB, separated with a comma:

 

.classA, .classB
{
  // some stuff
}

 

In this case, classB will have the same properties as classA. You can then define the classB properties that are unique to it, below the current CSS.

Link to comment
https://forums.phpfreaks.com/topic/121458-class-inheritance/#findComment-626489
Share on other sites

Is it possible to have one CSS class inherit another?

 

Although you can't do this strictly in css, you can play around with the markup and make a certain class be the parent div of a div that you want to have the styles inherited to. I don't know if that makes sense, but that's the logical reasoning behind the way css works.

Link to comment
https://forums.phpfreaks.com/topic/121458-class-inheritance/#findComment-626585
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.