Skip to content
Related Articles

Related Articles

CSS | url() Function

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 21 Aug, 2019

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
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!