Cannot display local image file using background-image CSS property
See original GitHub issueI can’t seem to be able to read an image file from disk and set it as CSS background-image. The file correctly loads into the src attribute of an <img>
tag and shows correct path in the inspector as:
C:\Users\Alex\Desktop\~tmpPreview\frame-9.png
but when it loads as CSS background-image, the path appears to be mangled like,
file:///C:/Userslex%C3%9Esktop~tmpPreview%0Frame-9.png
and the image never loads. console.log() shows the correct path.
Is this a bug or something I am unaware of?
Using: node-webkit-v0.10.0-rc2 / Windows 7 64-bit
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to fix CSS background-image not working | HTML/CSS
1. Check that your CSS file is linked correctly in your HTML file. · 2. Make sure the image path is set correctly...
Read more >html - CSS Background Image Not Displaying - Stack Overflow
According to your CSS file path, I will suppose it is at the same directory with your HTML page, you have to change...
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 is...
Read more >background-image - CSS: Cascading Style Sheets | MDN
The background-image CSS property sets one or more background images on an element.
Read more >Fix CSS background image url not displaying ... - YouTube
Fix CSS background image url not displaying showing working in HTML CSS | Problem Solved Show SupportBuy Me a COFFEE: ...
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
Try this:
This should be working with latest version now.
In 0.13 we changed to an optimized architecture so more features can be supported, see http://nwjs.io/blog/whats-new-in-0.13/ and it’s good for keeping up with Chromium upstream – we released with Node.js v6.0 and new Chromium versions within 1 day after upstream release.
The new version would fixed many issues reported here and we’re scrubbing them. This issue is closed as we believe it should be fixed. Please leave a message if it isn’t and we’ll reopen it.