-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background image for div is not loaded #1470
Comments
Is this a local file on your machine? If so, sounds similar to question #1472 -- you are trying to load in a local file as in-page resource and you just can't do that. (A web page cannot and should not be able to access your local files.) But as I mentioned in the other thread, you could easily set-up a simple server in node to serve the files to you in the way the browser expects. |
Yes, all my files are local. This works in CSS:
But this doesn't:
The font is loaded but it does not look correct when viewed thru dev tools sources tab. Font file type (woff etc.) does not make any difference. Using base64 ASCII as font source does work. |
Hmm, but it is at least loading it? Try checking/setting that the local server is sending the correct content-type header for the font type (for truetype I think it is "font/ttf" now, but it used to something else which should still work). If it is wrong, it might possibly screw up the rendering. If that works and you are serving up lots of different file types, you might want a more full-fledged local server that will take care of all that for you. There are a number of web server node packages of various complexity, but I haven't tried them. You could also install a full php-enabled Apache setup with something like The Uniform Server pretty quickly. |
@kkfin, as @vonGameTheory points out, this looks related to your setup. If you want to test against a local page with local resources, you probably want to setup a server and use |
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
The HTML code will be generated, text above is just a simple example.
What is the expected result?
JPG file of the web page with image as background.
What happens instead?
A JPG file is created correctly but no image on the background of the web page. The other style definitions in CSS (for H1 and P) are handled correctly i.e. the text colors are correct in generated JPG file.
If I define the image in CSS as base64 coded ASCII
the image on the background of the web page is shown correctly.
I've tried all kinds of path settings for the background image in CSS (absolute and relative) with no success.
Defining images as Base64 ASCII makes CSS file quite large (as we have several images on pages) so referring to them using just path would be nice.
Am I missing some definition from somewhere so the images would be loaded using path setting in CSS?
The text was updated successfully, but these errors were encountered: