'How to use local file as background image url
What should I change to insert a local link to C:\xampp\htdocs\Folder instead of the https://source.unsplash.com/1600x1050/?nature.
I am using Bootstrap 4 and this is my css
.jumbotron{
background:
linear-gradient(
rgba(0, 0, 250, 0.25),
rgba(125, 250, 250, 0.45)
),
url(https://source.unsplash.com/1600x1050/?nature);
background-repeat: no-repeat;
background-attachment: fixed;
color:white !important;
}
Thanks in advance
Solution 1:[1]
I guess that C:\xampp\htdocs\ is the root of your web site, meaning that relative URL / in your HTML, CSS and JavaScript files will probably point to C:\xampp\htdocs\. If so, URL /Folder/pic.jpg might just work for you, since that will internally translate to file C:\xampp\htdocs\Folder\pic.jpg.
.jumbotron{
background:
linear-gradient(
rgba(0, 0, 250, 0.25),
rgba(125, 250, 250, 0.45)
),
url("/Folder/pic.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
color:white !important;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bart Hofland |
