I would like to create border with linear gradient border, rounded corners and transparent background.
I have:
.btn-gradient-1 {
border-width: 4px;
border-style: solid;
border-image: linear-gradient(to right, darkblue, darkorchid) 1;
}
.btn-gradient-2 {
background: linear-gradient(white, white) padding-box, linear-gradient(to right, darkblue, darkorchid) border-box;
border-radius: 50em;
border: 4px solid transparent;
}
.parent {
display: flex;
flex-wrap: wrap;
gap: 1rem;
background-color: red
}
<div class="parent">
<button class="btn-gradient-1">Button One</button>
<button class="btn-gradient-2">Button Two</button>
</div>
Problem is that linear-gradient
not accept transparent
color value. Is there any hack? The button must have transparent background.