< Html Tutorial

Html images

← Previous Next →

In HTML, images are defined with the img tag. The tag is empty, it contains attributes only, and does not have a closing tag.


<img src="url" alt="some_text">

The src attribute specifies the URL (web address) of the image:


<img src="pic_hill.jpg" alt="Hill Station View" style="width:400px;height:250px;">

Image Size - Width and Height

You can use the style attribute to specify the width and height of an image. The values are specified in pixels (use px after the value):

<img src="icon.gif" alt="Website Icon" style="width:128px;height:128px;">
← Previous Next →