css3 - How do I make a CSS drop shadow responsive? -
i have following drop-shadow applied svg image. problem when site scaled down lower res shadow gets further , further away image. drop-shadow filter not allow use percentages.
#turqlogo img { display: block; margin: auto; width: 4%; -webkit-filter: drop-shadow(.5em 0px 0px black); /* chrome, safari, opera */ filter: drop-shadow(.5em 0px 0px black); }
anyone have trick make shadow stay in same position site being viewed @ different resolutions?
use 1vw instead of .5em.
1vw = 1% of viewport width.
-webkit-filter: drop-shadow(1vw 0px 0px black); /* chrome, safari, opera */ filter: drop-shadow(1vw 0px 0px black);
example, svg drop shadow keeps it's distance when scaled:
Comments
Post a Comment