Home HTML CSS JavaScript React Gamedatum.com
× Home HTML CSS JavaScript React Gamedatum.com

Images


Images is one of the most important elements of a web page. The ability to display an image on web page is one of the primary targets of a website.

The image tag

A basic attribute of the image tag is the alt attribute which provides an alternate text for an image and helps the search engines to find the image.

               
                
    <!-- the image tag -->
  <img src="html5.png" alt="HTML5 logo">
                
                
              

The image:

HTML5 logo

The image tag can also accept the width and height attributes:

               
                
    <!-- the image tag with width and height attributes-->
  <img src="html5.png"  width="250" height="350" alt="HTML5 logo">
                
                
              

An alternative way of altering the size of the image is by using the style attribute

For example:

               
                
    <!-- the image tag with width and height attributes-->
  <img src="html5.png"  style="width:250px;height:350px;" alt="HTML5 logo">
                
                
              

Both ways are equally correct.

Please note that you must own the copyrights for all the images that you use online on your digital projects.