CSS3 Gradient border

In this example below you will see how to do a CSS3 Gradient border with some HTML / CSS and Javascript

This awesome code was written by pushpanathank, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright pushpanathank ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>CSS3 Gradient border</title>
      <link rel="stylesheet" href="css/style.css">



  <a class="gradient-border">Sample Text</a>



/*Downloaded from https://www.codeseek.co/pushpanathank/css3-gradient-border-vWjOdm */
body {
  padding: 10em 0 0;
  text-align: center;
.gradient-border {  
    border: 6px solid transparent;
    border-image: linear-gradient(to right, #0865F1 0%, #C704F6 100%);
    border-image-slice: 1;
    background: #fff;
    color: #000;
    font-size: 2em;
    padding: 10px 40px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;

.gradient-border:hover {
    background-color: white;
    background: linear-gradient(to right, #0865F1, #C704F6);
    color: #fff;