CSS <url> Data Type

The CSS <url> data type is a pointer to a resource. The resource could be an image, a web font, a filter, or something else.

When you see <url> (including the < and >) anywhere in the CSS specifications, this refers to the fact that the value can be any valid URL.

URL stands for Uniform Resource Locator. Basically, you use this to point to a file on the web. When you do this, you specify the resource by using functional notation.

Here's an example of using the background-image property to specify the location of a background image:

The double quotes are optional. And you can also use single quotes. So all of the following declarations are valid:

You can specify the same resource by using a relative URL, an absolute URL, or a root-relative URL. Here are examples of all three:

Here's a working example:

Official Syntax

The asterisk (*) indicates that the preceding group occurs zero or more times.

Explanation of the values below.

string
Specifies the URL as a valid string value.
url-modifier
This can be used to change the meaning or the interpretation of the URL somehow. The value is either an ident or a functional notation.

CSS Specifications