jordanwb Posted August 26, 2008 Share Posted August 26, 2008 Is it possible to have one CSS class inherit another? Quote Link to comment Share on other sites More sharing options...
haku Posted August 26, 2008 Share Posted August 26, 2008 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. Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted August 27, 2008 Share Posted August 27, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.