Skip to content
Related Articles
Open in App
Not now

Related Articles

CSS | url() Function

Improve Article
Save Article
Like Article
  • Last Updated : 01 Jul, 2022
Improve Article
Save Article
Like Article

The url() function is an inbuilt function which is used to include a file. The parameter of this function is absolute URL, relative URL or a data URI. The url() function can be used for background-image, border-image, list-style-image, content, cursor, border-image, border-image-source, src as part of a @font-face block, and @counter-style/symbol. 


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

Parameters: This function accepts single parameter url which holds the url in string format. 

The examples of url are:

<css_property>: url("")
<css_property>: url('')
<css_property>: url(

Below example illustrates the url() function in CSS: 



<!DOCTYPE html>
    <title>CSS url() function</title>
        body {
            background-image: url(
        h1 {
    <h2>CSS url() function</h2>



Supported Browsers: The browsers supported by url() function are listed below:

  • Google Chrome 1
  • Edge 12
  • Internet Explorer 3
  • Firefox 1
  • Safari 1
  • Opera 3.5
My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!