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

How a CSS fish animation works

Overriding 'alert' to write to 'console.log'

Simple animation spacing out letters in an centred phrase