CSS3 Gradient border

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

Thumbnail
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" >

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

  
</head>

<body>

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

</body>

</html>

/*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;
    cursor:pointer;
}

Comments