How would I use a CSS inherit when I am using a selector method of styling.
so if I want to style the label I can simply do like this: .stylethis label{style}. But I want to inherit the styles from a different class, like how I am attempting in my CSS, I am trying to inherit style from the class "usethis" to '.stylethis label' .. kind of like this
/* Make second-level headers green */
h2 { color: green; }
/* ...but leave those in the sidebar alone so they use their parent's */
#sidebar h2 { color: inherit; }
I want to do like that, except in the place of #sidebar h2 I would put #sidebar 'my class name'?
.usethis{
color:red;
font-size:12px;
}
.stylethis label .usethis{
color:inherit;
font-size:inherit;
}
<div class="stylethis">
<label>jay chacko</label>
</div>