I am trying to add a shadow effect to a <rect>
element in the most simple way possible. I have tried a range of different filters and CSS properties, but it does not work.
http://codepen.io/anon/pen/rhKxd
<svg width="960" height="500">
<rect width="170" height="100" stroke-width="0" transform="translate(250,100)"></rect>
</svg>
CSS:
rect {
fill: orange;
box-shadow: 2px 2px 2px #666;
-webkit-filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
-moz-filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
-ms-filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
-o-filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
}
The only thing that works is SVG filter with offset and blur, but is this the only way to do it?