As C2 games use canvas, html attributes or CSS do not apply to sprites. There's many ways to achieve this effect. I'd just create a black sprite, set it to be 5px bigger that the target sprite, and change the zindex so that it's behind it. If you then plan to move it, simply pin it.