Last Updated : 14 Dec, 2021
The HTML <object> vspace Attribute is used to specify the number of whitespace on the bottom and top side of an object.
Syntax:<object vspace="pixels">
Attribute:
Note: The <object> vspace Attribute is not supported in HTML 5. Use CSS margin property instead of this attribute.
Below examples illustrate the <object> vspace attribute in HTML:
Example 1: In this example the object with 50px margin on top and bottom.
<!DOCTYPE html>
<html>
<head>
<title>
HTML object vspace Attribute
</title>
</head>
<body>
<center>
<h1 style="color:green">GeeksforGeeks</h1>
<h4>
HTML <object> vspace Attribute
</h4>
<br>
<object data=
"https://www.geeksforgeeks.org/wp-content/uploads/Geek_logi_-low_res.png"
width="350px" height="150px" vspace=50>
GeeksforGeeks
</object>
</center>
</body>
</html>
Output:
Example 2:
<!DOCTYPE html>
<html>
<head>
<title>
HTML object vspace Attribute
</title>
</head>
<body>
<center>
<h1 style="color:green">GeeksforGeeks</h1>
<h4>
HTML <object> vspace Attribute
</h4>
<h4>Object without vspace:</h4>
<object data=
"https://media.geeksforgeeks.org/wp-content/uploads/20190822082748/child.png"
width="50%" height="150px">
GeeksforGeeks
</object>
<h4>Object with 25 vspace:</h4>
<object data=
"https://media.geeksforgeeks.org/wp-content/uploads/20190822082748/child.png"
width="50%" height="150px" vspace="25">
GeeksforGeeks
</object>
</center>
</body>
</html>
Output:
Supported Browsers: The browsers supported by HTML <Object> vspace attribute are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4