CSS url() function

Definition and usage

CSS url() The function allows you to include files in the style sheet.

url() The function can be used in the following properties and rules:

Example

url() Some usage examples of the function:

background: lightblue url("img_tree.gif") no-repeat fixed center;
background-image: url("paper.gif");
border-image: url(border.png) 30 round;
border-image-source: url(border.png);
content: url(w3css.gif);
cursor: url(myBall.cur);
list-style: square inside url("sqpurple.gif");
list-style-image: url('sqpurple.gif');
mask: url(w3logo.png) no-repeat 50% 50%;
mask-image: url(w3logo.png);
@import url("navigation.css");
@namespace url(http://www.w3.org/1999/xhtml);

CSS syntax

url(string)
Value Description
string Required. URL or ID of SVG shape.

Technical details

Version: CSS3

Browser support

The numbers in the table indicate the browser version that first fully supports this function.

Chrome Edge Firefox Safari Opera
1 12 1 1 3.5