HTML | <img> vspace Attribute

The HTML <img> vspace Attribute is used to specify the number of whitespaces on bottom and top side of an image.

Syntax:

<img vspace="pixels">

Attribute Values:



  • pixels: It specifies the number of whitespaces on top and bottom of an image in terms of pixels.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html
  
<head
    <title
        HTML img vspace Attribute 
    </title
      
    <style>
        h1, h2 {
            color:green;
            text-align:center;
        }
        h3 {
            font-weight:bold;
        }
    </style>
</head
  
<body
  
    <h1 style="color:green;"
        GeeksforGeeks 
    </h1
  
    <h2>HTML <img> vspace Attribute</h2>
      
    <h3>Image without vspace Attribute</h3>
      
    <p>
        <img id="myImage" src
            alt="Submit" width="42"
            height="42" align="middle"/>
        It is a computer science portal for geeks
    </p>
      
    <h3>Image with vspace Attribute</h3>
      
    <p>
        <img id="myImage" src
            alt="Submit" vspace = "60" width="42" height="42"
            align="middle"/>
        It is a computer science portal for geeks
    </p>
</body
  
</html>                    

chevron_right


Output:

Supported Browsers: The browser supported by HTML <img> vspace Attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera


My Personal Notes arrow_drop_up


If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.