As mentioned in other answers, you may use DHMTL behaviors to apply any style specified in your style sheet to your VML element as behaviors are supported from IE5 to IE9.
Start by creating a HTC file, eg: vmlcss.htc:
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="onpropertychange" ONEVENT="onpropertychange()" />
<PUBLIC:METHOD NAME="refresh" />
<SCRIPT LANGUAGE="JScript">
function onpropertychange()
{
if (event.propertyName == "className")
{
refresh();
}
}
function refresh()
{
// Set any VML attribute you may define in your stylesheet
element.fillcolor = element.currentStyle["fillcolor"];
element.strokecolor = element.currentStyle["strokecolor"];
// etc.
}
refresh();
</SCRIPT>
</PUBLIC:COMPONENT>
Then apply it to your VML elements. For your particular example, you would use:
<style>
v\:path
{
behavior: url(vmlcss.htc);
}
</style>
Finally, specify the styles as shown in your example:
.myRedPath
{
fillcolor: red;
strokecolor: yellow;
}
You may want to modify the behavior file to add support for all VML attributes.
One could use such a technique to write a library that draws shapes using VML or SVG (depending on the browser support) and allows styling through CSS. Support for SVG styles could then be added to the VML objects using such a behavior file by mapping each SVG style to the corresponding VML attributes.