CSS url() Function
Example
Some examples of where url() can be used:
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);
Definition and Usage
The CSS url()
function allows you to include a file
in the style sheet.
The url()
function can be used within the
following properties and at-rules:
- background
- background-image
- border-image
- border-image-source
- content
- cursor
- filter
- list-style
- list-style-image
- mask
- mask-image
- offset-path
- clip-path
- @font-face
- @counter-style
- @import
- @namespace
Version: | CSS3 |
---|
Browser Support
The numbers in the table specify the first browser version that fully supports the function.
Function | |||||
---|---|---|---|---|---|
url() | 1 | 12 | 1 | 1 | 3.5 |
CSS Syntax
url(string)
Value | Description |
---|---|
string | Required. A URL or id of an SVG shape |