This is my simple CSS:
.EggChart {
width: 5000px;
height: 100px;
}
.EggBar {
fill: teal;
}
And a simple fragment of HTML
<svg class="EggChart">
<rect class="EggBar" width="20" height="100" x="0" y="0"></rect>
</svg>
As I would expect this renders a single teal coloured rect within the SVG. The rect is coloured teal as it picks up the colouring correctly from the CSS. However if I change the latter CSS declaration to
.EggChart.EggBar {
fill: teal;
}
then the rect is black, the CSS styling is not picked up. Why? I thought class selectors in CSS could be strung together so that .EggChart.EggBar
would target elements of class .EggBar
within those of class .EggChart