HTML – images

<img>:

  • HTML img tag is used to display image on the web page.
  • It is an empty tag that contains attributes only.
  • “src” attribute is necessary that describes the path of the image.
<! DOCTYPE html>
<html>
      <body>
                  <img src=”logo.jpeg”/>
      </body>
</html>

Attributes <img> tag:

  1. alt: This attribute defines an alternate text for the image, if it can’t be displayed.
  2. width: It is an optional attribute to specify the width of image.
  3. height: It is used to specify height of image.
<!DOCTYPE html>
<html>
            <body>
                        <img src=”logo.jpeg” height=”180″ width=”300″ alt=”AmeerpetIT Logo”>
            </body>
</html>

Scrolling Image:

<!doctype html>
<html>
            <body>
                        <marquee> <img src=”logo.jpeg”/> </marquee>
            </body>
</html>
Scroll to Top