after build find background url path is wrong
See original GitHub issueThis is my project struct |------src |------|------assets |------|------|------bg.jpg |------|------views |------|------|------index.vue |------|------app.vue |------|------main.js
i write css in index.vue
body{ background: url(‘…/assets/bg.jpg’) no-repeat; background-size: cover; font-size: 62.5%; }
After i run “npm run build” i find dist folder struct like this |------dist |------|------static |------|------|------bg.jpg |------|------|------app.xxx.js |------|------|------app.xxx.css |------|------index.html
but in app.xxx.css i find the bg.jpg’s path is background:url(./static/bg.jpg?1b5ca27) i think it is wrong. how can i to fixed it?
And all build option i used default setting
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to fix CSS background-image not working | HTML/CSS
2. Make sure the image path is set correctly in the background-image url. Once you have made sure that your CSS file is...
Read more >CSS Background-Image Path Issues - Stack Overflow
I would use Firebug's "Inspect Element" function to find out whether there is another background setting taking precedence. URLs with spaces ...
Read more >Background images not working because of wrong path ...
I'm having the same trouble. We upgraded to 4.5.5 today and the URL path on CSS referenced background images started throwing 404 errors....
Read more >Forums - CSS - [Solved] Background Image Not Showing
1) The file name is EXACTLY right. · 2) The file path is EXACTLY right. This file path presupposes that the image folder...
Read more >I cannot create relative path links - CSS - Codecademy Forums
How do I get these to go away or at least show me what is wrong. ... would be url("your\\path\\here\\Resources\\images\\background.jpeg") ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems you are using a relative
publicPath
.publicPath
should be a root-relative path like/static
instead of./static
.@yyx990803 work for me! thanks a lot