Topic 7 : Image Element

“Used To Add Image To Your Page.

<h1></h1> ,  <p></p>, <a></a> these are known as pair tags beacuse they are having both opening and closing tag.

<img>,<br>,<hr> these are knowns as single tags becuse it is having only opening tag.

Syntax for Image Tag

<img src="rsportfoliologo.jpg" alt="rsportfolio" />
<!DOCTYPE html>

<html lang="en">

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Image Element(by rsportfolio.com)</title>

  </head>

  <body>

    <h4>Image Element</h4>

    <!-- rsportfoliologo.jpg is realtive url because this image is in our HTML folder -->

    <img src="rsportfoliologo.jpg" alt="rsportfolio" />

    <h4>Note :We use offline image ie downloaded in our system</h4>

  </body>

</html>

Output:

For Online Image:

  1. Search for image on google which you want to integrate in your image tag/ website 
  2. right click on image and select copy image address
  3. paste this url in src attribute of image tag
<!DOCTYPE html>

<html lang="en">

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Image Element(by rsportfolio.com)</title>

  </head>

  <body>

    <h4>Image Element</h4>

    <!-- rsportfoliologo.jpg is realtive url because this image is in our HTML folder -->

    <img

      src="https://m.media-amazon.com/images/M/MV5BYWRkN2M1NmQtZjhjMi00ODFjLTk2ODctYWJiOWNkNjg1OGY4XkEyXkFqcGc@._V1_FMjpg_UX1000_.jpg"

      alt="rsportfolio"

      width="500px"

      height="500px"

    />

    <h4>Note :We use Online image ie downloaded in our system</h4>

  </body>

</html>

Output:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top