Skip to content Skip to sidebar Skip to footer

Svg Path As Div Background

I have an SVG path (as below) that I want to use as a background in a div, does anyone know how to do this, I've searched the web but cant find any simple examples? ); background-size:cover; background-color:pink; }
<divclass="back"></div>

Solution 2:

you can't define an inline svg as background. You have 2 solutions here :

1 - store the svg as a separate file, and set it to background-image: url('path/to/your/svg/file.svg');

2 - If you really need to have it inline in your HTML for any reason, create another div, ste it to position absolute to make it fit ur main div. Then playing with z-index will lead you to the result you want

Post a Comment for "Svg Path As Div Background"