I\'m having difficulty with some background images not loading. I\'ve made some significant modifications to the initial create react app, my folder structure is now as follows
The issue was purely an issue with CSS in the App.css file:
App.css
.trees__tree {
background: url('../images/tree.png') no-repeat;
background-size: 30px; /** moved this property down */
float: left;
height: 50px;
width: 30px;
}
My issue was specifically that I did not have background-size: 30px; defined. Thanks for this.
Add homepage in package.json to run build in any apache server
{
"name": "app",
"version": "0.1.0",
"private": true,
"homepage": "http://{servername}/{foldername}/",
}
then create build in react using
npm run buildnpm install -g serveserve -s build