HTML Images

How to insert images in HTML?

Images improve the aesthetic appeal of a webpage while illustrating the concepts in its textual content. Use the <img> element to include new images in your document. This is a void element that only contains attributes. Here is its syntax

<img src = ?url? alt= ?text? >

Definations of code attributes

Note that src stands for source. This attribute tells the browser where it will find the image that you intend to display. The alt attribute is an alternative value that is displayed if a browser cannot display the image you selected correctly. Its value is user defined ? images can fail to display correctly because of a slow connection or an error in the src value.

Changing the default size of images

To change the size of an image that?s included in one of your webpages, use the width and height attributes. Below is an example that resets the size of an image to a square whose length is 300.

<img src="kites.jpg" alt="htmlkick" width="300" height="300">

Changing the default size of a website beforehand reduces chances of display issues that could cause the screen on which it is being loaded to flicker.

Link on Image

<a href="#"><img src="kites.jpg" alt="htmlkick" width="300" height="300"></a>