Crextio.com Latest Questions

Lara Ballard
  • 1
  • 1

How do I use CSS to add a background picture in a HTML page?

  • 1
  • 1

I’m having difficulty adding a picture to my HTML background page. How do I go about it please?

Related Questions

Leave an answer

Leave an answer


2 Answers

  1. You can do that in any of the two ways below;
    First, start an http server and replace the link with the one you get from the local server. Typically something like localhost/images/image.png
2. Use file:///
    To add a picture to your background page; Basically right click to open a file in the browser, copy the link in the address bar and try to use that as the URL in a background image.

  2. First, you should always make sure that your html page and images should be in the same folder.
    That is easy process to link pc images to html pages. Just give the image name(eg:- sun) and extension(eg : – .jpg, .png, .gif) in image tag.
    —If your html folder and image folder location is changed then you will give the full pc location.
    Suppose that your image location is in images folder of d: drive and your html is in desktop or anywhere in the pc: Then your img tag should look like this. ”Sun”