i can only see the background image when accessing the HTML file directly but not when accessing it through the localhost server (i’m using Flask as framework)
This is the code of the background part:
<style>
body {
background-image: url(file:///C:/Users/LENOVO/Desktop/chatbot-in-python-master/network.jpg);
background-repeat: no-repeat;
background-size: cover;
}
</style>
3
Answers
Nevermind it's because the local file system path and not a web server URL.However, recommend for me the best website to get the url without losing the quality of the image.
The addressing method is not correct!
First, try copying the image to the source folder (for convenience).
Or address using dots and slashes
Example:
or similar examples
you can not use of local file system path!
You can’t access the resource using that type of path since is a file system path.
You could upload images to imgur and generate a short link to the image without losing the quality of the image.