Hiding SVG that is referenced later

 An SVG would not show when it was hidden in a 'div' with 'display: none' and referenced later in a 'use' tag.


To fix this, I put the SVG in a 'defs' tag inside an outer 'svg' tag. I hide this outer 'svg' by saying: 'position: absolute', 'height: 0' and 'width: 0'. 




Comments

Popular posts from this blog

Minifying CSS

Violating Flickr's terms of service

How a CSS fish animation works