DEV Community

Saba beigi
Saba beigi

Posted on

2 1

Gradient Borders

Create gradient borders with the border-image property:

border:4px solid;
border-image: linear-gradient(135deg,#FF0000 0%,... #FF00AB 100%)1;
Enter fullscreen mode Exit fullscreen mode


<div class="stripe-1"></div>
<div class="stripe-1 blue-stripe-1"></div>
<div class="stripe-2"></div>
<div class="stripe-2 blue-stripe-2"></div>
<div class="stripe-1 stripe-3"></div>
<div class="stripe-1 stripe-3 blue-stripe-3"></div>
<div class="stripe-2 stripe-4"></div>
<div class="stripe-2 stripe-4 blue-stripe-4"></div>
Enter fullscreen mode Exit fullscreen mode
body{background-color:#283470;}
.stripe-1{
    position:absolute;
    top: 10px;
    left: 10px;
    height: 10px;
    width: 98%;
    background: -webkit-linear-gradient(left,rgba(58, 32, 92,1),rgba(58, 32, 92,.0));
    background: linear-gradient(90deg,rgba(58, 32, 92,1),rgba(58, 32, 92,.0));
}
.blue-stripe-1{
  background: -webkit-linear-gradient(left,#17E1E3,rgba(58, 32, 92,.0));
  background: linear-gradient(90deg,#17E1E3,rgba(58, 32, 92,.0));
  z-index:-1;
  top:20px;
  height:5px;
}

.stripe-2{
    position:absolute;
    top:10px;
    left:10px;
    height: 98%;
    width: 10px;
    background: -webkit-linear-gradient(top,rgba(58, 32, 92,1),rgba(58, 32, 92,.0));
    background: linear-gradient(180deg,rgba(58, 32, 92,1),rgba(58, 32, 92,.0));
}
.blue-stripe-2{
  gradient(top,#17E1E3,rgba(58, 32, 92,.0));
  background: linear-gradient(180deg,#17E1E3,rgba(58, 32, 92,.0));
  z-index:-1;
  left:20px;
  width:5px;
}

.stripe-3{
  top:auto;
  bottom:10px;
  right:10px;
  left:auto;
  background: -webkit-linear-gradient(right,rgba(58, 32, 92,1),rgba(58, 32, 92,.0));
  background: linear-gradient(-90deg,rgba(58, 32, 92,1),rgba(58, 32, 92,.0));
}
.blue-stripe-3{
  background: -webkit-linear-gradient(right,#17E1E3,rgba(58, 32, 92,.0));
  background: linear-gradient(-90deg,#17E1E3,rgba(58, 32, 92,.0));
  z-index:-1;
  bottom:20px;
  height:5px;
}

.stripe-4{
  top:auto;
  bottom:10px;
  right:10px;
  left:auto;
  background: -webkit-linear-gradient(bottom,rgba(58, 32, 92,.0),rgba(58, 32, 92,1));
  background: linear-gradient(-180deg,rgba(58, 32, 92,.0),rgba(58, 32, 92,1));
}
.blue-stripe-4{
  gradient(bottom,rgba(58, 32, 92,.0),#17E1E3);
  background: linear-gradient(-180deg,rgba(58, 32,92,.0),#17E1E3);
  z-index:-1;
  right:20px;
  width:5px;
}
Enter fullscreen mode Exit fullscreen mode

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay