create react app not loading css background images in dev or build

前端 未结 3 1599
执念已碎
执念已碎 2021-02-20 07:39

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

3条回答
  •  再見小時候
    2021-02-20 07:55

    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;
    }
    

提交回复
热议问题