The src attribute identifies an image by a URL. The image defined by the URL is retrieved by the browser and inserted into the document when the page loads. This is the most straightforward, and is the only way to go if you want to link to an external image an image hosted on another site. Hotlinking is sometimes just fine. For instance, in the above example we hotlinked an image from Wikimedia Commons. This is a Public Domain image hosted by a media provider. No problem.
How do we put an image on a webpage?
The previous chapter covered some very important HTML elements, but we were only dealing with a single web page. Links and images are fundamentally different from those elements in that they deal with external resources. Links point the user to a different HTML document, and images pull another resource into the page.
In the beginning, the Web was just text, and it was really quite boring. Fortunately, it wasn't too long before the ability to embed images and other more interesting types of content inside web pages was added. There are other types of multimedia to consider, but it is logical to start with the humble element embeds an image into the document. In order to put a simple image on a webpage, we use the element embeds an image into the document. This is an empty element meaning that it has no text content or closing tag that requires a minimum of one attribute to be useful — src sometimes spoken as its full title, source. So for example, if your image is called dinosaur.
Descriptive text for your image. May also include attribution to the originator or creator of this image. The point can have a number of properties:. If you'd like to disable your Instant Article from automatically rendering panoramic photos as , add the tag data-fb-disable Note: The aspect-fit , aspect-fit-only , fullscreen , and non-interactive data-mode attributes will not work with videos. You can add attribution to your image to provide additional context to the original source of the image. Docs Tools Support. Instant Articles.