Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Consider below code :

<body style="background-image:url('clouds.jpg')">
.
.
.
.
.
</body>

I'm not understanding what this url() does in above code means.

I tried with below code but it didn't work out, it didn't display a background image.

<body style="background-image:clouds.jpg">
.
.
.
.
.
</body>

Someone, please explain me the role of url() and where it can be used.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
141 views
Welcome To Ask or Share your Answers For Others

1 Answer

URL stands for universal resource locator. In this case, basically, URL is the code, or sometimes called path that tells from where the resource for carrying out an action needs to be taken from. For example, if your image for the background is stored in a folder called images that exists in the hard disk/drive d, then this would be the path: d:imagesclouds.jpg.

Note that if the image to be taken is from the same folder where you have saved your HTML document, the image name is enough, and the complete path is not needed.

Hope it helps...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...