Currently, I am working on a webpage and facing an issue while trying to set a background image for a Material UI element using the background-image
CSS property. Despite researching online for solutions, I am unable to make the image appear.
P.S.1: I even attempted changing the Material UI element to a regular one but that did not resolve the problem.
P.S.2: Interestingly, placing the image inside a container displays it, however, this is not the desired outcome.
UPDATE1: After adding height and width to the container, I still could not get the image to display...
import React from 'react';
import Paper from 'material-ui/Paper';
import IconButton from 'material-ui/IconButton';
import ActionHome from 'material-ui/svg-icons/action/home';
const styles = {
paperContainer: {
backgroundImage: `url(${"static/src/img/main.jpg"})`
}
};
export default class Home extends React.Component{
render(){
return(
<Paper style={styles.paperContainer}>
</Paper>
)
}
}