HTML border attribute

HTML border attribute: The HTML border attribute is used for setting the box radius, table radius and more according to user requirement.

HTML border attribute

The HTML border attribute can be used mainly used in CSS. It is the only easiest way for creating border color and more.

Example: Solid Border 

<style>
   bordered {
    width: 200px;
    height: 100px;
    padding: 20px;
    border: 10px solid yellowgreen;
  }
</style>
<div class="bordered">
Box with a border
</div>

Output:



HTML border attribute

Example: Border with radius

<style>
    bordered {
    width: 200px;
    height: 100px;
    padding: 20px;
    border: 1px solid darkorange;
    border-radius: 8px;
  }
</style>
<div class="bordered">
Box with a border
</div>

Output:

HTML border attribute with radius

Example: Bottom Border

<style>
  a {
    font-size: 2em;
    color: limegreen;
    text-decoration: none;
    border-bottom: 1px solid darkorange;
  }
  a:hover {
    color: darkorange;
    border-width: 3px;
  }
</style>
<p>You can use borders to create custom underlines on hyperlinks, like this:</p>
<p>Go to the <a target="_blank" href="https://www.freshersnow.com">Freshersnow Homepage</a>.</p>

Output:

HTML bottom border