What is a link to HTML?

When a person creates a web page that contains an image, the image is not actually inserted into the page with the rest of the information. To view images on the web, the HTML link is used instead of inserting an image into the page. To use the HTML Image link with the HTML mark used to provide information where the image is stored and is available. This brand can be used with all browsers and can be used to load all types of images that are supported by the browser.

The use of the brand itself does not provide any information on the website that should contain a picture. Two attributes are required for HTML link that are required to load the image when the web page loads. Several optional attributes may also be included in providing additional information. The attributes that are required to write the link image are src and alt .

SRC The HTML Image Link attribute provides a web address or URL where the image is located. URL canhave one of two forms. The absolute URL provides a complete web address that is directed to the picture on another site. An example of the inclusion of the absolute address of the URL for the SRC attribute would be: SRC = "http://www.website.com/image.jpg" - where web.com points to another website and image.jpg points to a particular picture.

The second option for the URL in the SRC attribute is to write a relative URL. In the case of a relative URL address, the web address provides a link to the image in the same website directory. The relative URL is a shortened version of the absolute URL, because the image is located in the same location as on the website. Examples of SRC attribute with relative URL are: src = "image.jpg" or src = "images/image.jpg". The only difference in these examples is the place where the picture is located in the image folder in the second example.

Another required attribute is alt that provides an alternative text for the image. It is not a text that appears if the user hits mice via an image, but a text that appears if the image cannot be displayed for some reason. There are many reasons why the image may not be displayed, including cases where the URL is incorrect or broken in the SRC attribute, or when a user who has visual impairment uses the screen reader.

The most basic code for the HTML image link will look like the following: text. Since the brand does not have the end tag, it is important to end it so that the browser knows that the instructions have ended. The SRC attribute points to the image, so it is important to ensure that links to other sites are not broken and that images do not move in the website directory, and fix links where problems occur.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?