The HTML border attribute is used to set the visible border width to most HTML elements within the body.
Note: The HTML border attribute is not supported in HTML5.
Syntax:Â Â
<tag border="value">Supported tags:Â Â
Example 1: In this example, we will see code for the table border attribute in an HTML document.Â
<!DOCTYPE html>
<html>
<head>
<title>
HTML table border Attribute
</title>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>HTML table border Attribute</h2>
<table border="1">
<caption>Author Details</caption>
<tr>
<th>NAME</th>
<th>AGE</th>
<th>BRANCH</th>
</tr>
<tr>
<td>BITTU</td>
<td>22</td>
<td>CSE</td>
</tr>
<tr>
<td>RAM</td>
<td>21</td>
<td>ECE</td>
</tr>
</table>
</body>
</html>
Output:Â

Example 2: In this example, we will see code for Image border attribute in an HTML document.Â
<!DOCTYPE html>
<html>
<head>
<title>
HTML img border Attribute
</title>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>HTML img border Attribute</h2>
<img src=
"https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo3.png"
alt="GeeksforGeeks logo"
border="5">
</body>
</html>
Output:Â

Example 3: In this example, we will see code for Object border attribute in an HTML document. . Â
<!DOCTYPE html>
<html>
<head>
<title>
HTML object border Attribute
</title>
</head>
<body>
<center>
<h1>GeeksForGeeks</h1>
<h1>
HTML <object> border Attribute
</h1>
<br>
<object data=
"https://www.geeksforgeeks.org/wp-content/uploads/Geek_logi_-low_res.png" width="550px"
height="150px" border="4">
GeeksforGeeks
</object>
</center>
</body>
</html>
Output:Â
Â

Supported Browsers:
- Google Chrome 1
- Edge 12
- Firefox 1
- Apple Safari 3.5
- Opera 1