English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article introduces the usage of the HTML img vspace attribute, online examples demonstrate how to use the HTML img vspace attribute, browser compatibility, syntax definition, and detailed information about its attribute values.
Top and bottom margins are 38 Pixel images:
!DOCTYPE html <html> <head> <title>HTML: <img> vspace attribute - Basic Tutorial Website oldtoolbag.com</title> <body> <h4>Images without vspace:</h4> <p><img src="smiley.gif" alt="Smiley face" width="42" height="42" align="middle"> This is some text. This is some text. This is some text.</p> <h4>Images with vspace:</h4> <p><img src="smiley.gif" alt="Smiley face" width="42" height="42" align="middle" vspace="38">This is some text. This is some text. This is some text.</p> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the vspace attribute.
HTML5 The <img> vspace attribute is not supported. Please use CSS instead.
In HTML 4.01 The vspace attribute of <img> is deprecated in HTML.
The vspace attribute specifies the whitespace at the top and bottom of the image.
In HTML 4.01 In this example, the vspace attribute of <img> is deprecated. Please use CSS instead.
CSS Syntax: <img style="margin: 50px 0px">
CSS Example: Image with Margin
In our CSS tutorial, you can find more about margin property. Details.
<img vspace="pixels">
Value | Description |
---|---|
pixels | Whitespace at the top and bottom of the image, in pixels. |