I am currently working on a simple react image that will have profile pictures of different user. I have run into an issue when I try to set the background image. I will have two background images but I am unable to place any. The images are in my public/images/ but nothing is showing up in the webpage.
I am adding the image in body{} in the CSS file "App.css".
App.css
body {
margin: 0;
font-family: var(--fontFamily);
font-size: var(--fontSize);
background-image: "url(/images/bg-pattern-top.svg)";
background-size: contain;
background-position: top;
}
App.js
import './App.css';
import PorfileCard from './PorfileCard';
function App() {
return (
<div>
<PorfileCard/>
</div>
);
}
export default App;
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);



background-image: "url(/images/bg-pattern-top.svg)";it should bebackground-image: url(/images/bg-pattern-top.svg);I would also remove the leading slash as that could cause a path error depending on server setup.