CSS <url> Data Type

Description

The <url> CSS date type represents a reference to a file or file fragment. It is specified with the url() function. The <url> data type is commonly used for images, but also for loading web fonts or defining filter or clipping path effects (in which case the identifier must link to a fragment within an SVG file).

Syntax

<url> = url( <string> <url-modifier>* )

Values

  • <string>Represents a reference to a file or file fragment.

Example

<div></div>
div {
   width: 300px;
   height: 226px;
   background-image: url('images/sunset.jpg');
   margin: 10px;
}

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
312113.51
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
11841411.0

Last updated by CSSPortal on: 9th December 2019