Grokking CSS for Web Development
0% completed
CSS url() Function
The declaration background-image: url("../images/backpack.svg"); paints a picture behind an element, but only if the browser can find that file. url() holds the address of a file, and the property around it decides what the browser does with the file. Most of the work in using url() is writing an address that leads to the right file.
Where url() appears
These are the places you will meet it most often:
background-image, for a picture behind an element;list-style-image, for a picture in place of a list bullet;contentin::beforeand::after, to insert an image;
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%