SVG file as a background

Viewed 29
body {
      background-image: url('./circle.svg');
}

straight up not working for me.

1 Answers

Are you sure the SVG is in the right directory? try placing it in the same directory as your style.css and adding background-size: cover;

If your SVG is in the same directory as your css this should work:

body {
    background-image: url('circle.svg');
    background-size: cover;
}

If your SVG is in the parent directory of your style .css make sure the url() has ../ infront of it.

Related