Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

HTML | border attribute

  • Last Updated : 07 Nov, 2020

The HTML border attribute is used to set visible border width to most HTML elements within the body.

Syntax:  

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<tag border="value">

Supported tags:  

Example: table border attribute. 



HTML




<!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: Img border attribute. 

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML img border Attribute
    </title>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
 
    <h2>HTML img border Attribute</h2>
 
    <img src=
        alt="GeeksforGeeks logo"
        border="5">
</body>
 
</html>

Output: 
 

Example: Object border attribute.  

HTML




<!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=
                width="550px" height="150px" border="4">
            GeeksforGeeks
        </object>
    </center>
</body>
 
</html>

Output: 
 

Supported Browsers: The browsers supported by HTML border attribute are listed below: 

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

 




My Personal Notes arrow_drop_up
Recommended Articles
Page :