2

I want to integrate the following background on all the pages of my site :

https://www.svgbackgrounds.com/#endless-constellation

There are several methods to do this. Embed the svg code into css, embed the svg code in html, save to an svg file, ...

Which method should I use? What is good practice ?

ML61
  • 41
  • 2
  • 8
  • you should read this thread: https://stackoverflow.com/questions/492809/when-to-use-img-vs-css-background-image hope it helps! – jpnazar Mar 13 '19 at 03:18
  • Have you checked the "HOW TO USE" link on that site? https://www.svgbackgrounds.com/demo/ – arieljuod Mar 13 '19 at 04:05
  • When the code is included in html, we can animate it with the css or js – ML61 Mar 13 '19 at 04:37

1 Answers1

1

Since it is a background I'd suggest you include it in your CSS.

Abhicoding
  • 115
  • 1
  • 7
  • Agreed, if it can be done with css I see no reason to add an SVG – Chris Sandvik Mar 13 '19 at 03:25
  • For the record adding SVG into CSS has the advantage of being reusable where as inline SVG is easier to with CSS ( you don't need to create a new dataURI). In your case I agree CSS would be the cleanest solution. – stwilz Mar 13 '19 at 04:19