Loading Please Wait...

Logo Lynxsia IT Solutions

HTML Images

HTML Images

Images are very helpful for creating interactive web pages. Images increase the visualization and appearance of the web page.

<img> Tag

Use <img> tag to include image on the web page. It is an empty tag, hence no closing tag is required.

Let's see with some example
        
          <!DOCTYPE html>
          <html>
            <body>
              <img src="https://lynxsia.com/upload/logo/lynxsia-it-solutions-logo_1661513244.png">
            </body>
          </html>
        
      
<img> Tag Attributes

Use <img> tag has following attributes

  • src: To specify the URL/path of the image.
  • alt: To specify the alternate text if the image failed to load.
  • width: To specify the width of the image.
  • height: To specify the height of the image.
  • loading: To specify whether a browser should load an image immediately or to defer loading of images until some conditions are met.
<img> Alternate Text
Let's see with some example
        
          <!DOCTYPE html>
          <html>
            <body>
              <img src="https://lynxsia.com/upload/logo/lynxsia-it-solutions-logo_1661513244" alt="Logo">
            </body>
          </html>
        
      
<img> Size - Width And Height

Use width and height attribute to specify the size (in pixel).

We recommend to use style and CSS instead of width and height

Let's see with some example
        
          <!DOCTYPE html>
          <html>
            <body>
              <img src="https://lynxsia.com/upload/logo/lynxsia-it-solutions-logo_1661513244.png" width="100" height="100"><br>
              <img src="https://lynxsia.com/upload/logo/lynxsia-it-solutions-logo_1661513244.png" style="width: 100px; height: 100px;">
            </body>
          </html>
        
      
<img> As A Link
Let's see with some example
        
          <!DOCTYPE html>
          <html>
            <body>
              <a href="https://lynxsia.com/">
                <img src="https://lynxsia.com/upload/logo/lynxsia-it-solutions-logo_1661513244.png" style="width: 100px; height: 100px;">
              <a>
            </body>
          </html>
        
      
Animated Image
Let's see with some example
        
          <!DOCTYPE html>
          <html>
            <body>
                <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/300px-Rotating_earth_%28large%29.gif" style="width: 100px; height: 100px;" alt="Source Wikipedia">
            </body>
          </html>
        
      

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved