Here is the html of the spinner (loader)
<svg viewBox="25 25 50 50">
<circle r="20" cy="50" cx="50"></circle>
</svg>
I want to know how I can place a logo inside of this. I can add the css if someone suggests it. But so far I have been unsuccessful. I have tried to add inside but the results are always incredibly wonky.
tags and centering the logo inside was only a temporary fix, when the screen size changed the logo was off center or changing size. I need it to be contained inside of the spinner.
2
Answers
You can perhaps add a img tag inside the circle;
You can read more here;
https://www.w3schools.com/html/html_images.asp
You could try this:
<svg>
to a<symbol>
and add a unique ID<use>
element referencing the previously created symbolAlternative: convert your logo to a data URI and use an
<image>
element instead.However, please make sure your logo image is highly optimized and lightweight – otherwise you need a loading spinner for your loading spinner 😉
The spinner used in the example was taken from this github repository: SVG Spinners (CSS & SMIL).