I am trying to follow this link to get inheritance in CSS to work. It is the accepted answer so I assume it works that way. I don't want to have a div layer use multiple classes(Unless that is the correct way) like this to get the job done.
<div class="bannerMain ShadowBanner" >
This div is with class bannerMain that also has shadowBanner properties
</div>
What is wrong with what I am doing here? The div that uses banner main should have been on the top and the one that uses shadow main should have been at the bottom since I am using bottom: 50px; there. Also only the div with class ShadowBanner should have had a shadow because its defined in the ShadowBanner class.
Edit
What I want to do is have one Css class that has the basic look and feel that would apply to all div layers on the page. In this case bannerMain is such a class which I have applied to the div with id=main. Then for each other layer I would like to have what is contained in the Css class 'bannerMain', plus whatever else is defined for it in its own specific class. In the example above I have applied the Css shadowBanner to the div with id=withShadow
The end result would be the "main" div showing without a shadow and no background color and the "withShadow" div shown as having a black background and having a shadow and the remaining properties assigned to it in the shadowBanner Css class along with inheriting display: block; and text-align:center; from the parent Css class "main"
I am trying to figure out inheritance in Css and trying to see if there are any parallels with inheritance as observed in the regular Java or C# world