Today is not my day for understanding CSS.
Given the following simple CSS
.EggBar {
fill: teal;
}
and the following HTML fragment
<svg>
<rect class="EggBar" width="20" height="100" x="0" y="0"></rect>
</svg>
the rendered result is just what I'd expect: a teal rectangle, width 20 and height 100, within the SVG on the page.
However, if I change the two fragments to
.EggBar {
width: 20px;
height: 100px;
fill: teal;
}
and
<svg>
<rect class="EggBar" x="0" y="0"></rect>
</svg>
i.e. I hand over responsibility for setting the width and the height of the rectangle from the SVG element to its CSS class, then the rectangle is not rendered - I'm guessing it ends up with width and height zero. Why? Why don't the two methods produce identical results?