Definition and Usage. The src property sets or returns the value of the src attribute of an image. The required src attribute specifies the URL of an image. The backgroundImage property sets or returns the background image of an element. Tip: In addition to the backgroundImage = "url('URL')|none|initial| inherit". The src attribute specifies the URL (web address) of the image: The alt attribute provides an alternate text for an image, if the user for some reason cannot view.