I want to change the font color if it have specific class.
HTML:
<p class="status">
test
<span class="has-this">test</span> (all turn to red)
</p>
<p class="status">
<span>test</span>
</p>
SCSS:
.status {
font-size: 25px;
color: blue;
height: 30px;
line-height: 30px;
padding-right: 10px;
.has-this & {
color: red;
}
}
If it has 'has-this' class inside I want to change font color to red. Is it possible to achieve this by using css only ?(no js) The status dynamically generate some with has-this some not .
Here my codepen http://codepen.io/anon/pen/ZbGyZm