I am currently developing a website where I have a div covered by an SVG. When I use this SVG as a background image and apply background-position: center center, it functions as expected. However, my issue arises when I try to add additional CSS in this manner on smaller screens.
I have attempted to achieve the same effect without using background-image by trying object-fit: cover; object-position: center center, but unfortunately, it didn't work as intended.
The following code works perfectly:
<div style="background-image: {{asset('assets/vectors/bg.svg')}}; height: 100vh; background-position:center center">
However, I would like to accomplish the exact same effect while being able to apply additional CSS to it, like so:
<div>
<svg> /* This way I can add extra css styles */
</div