Just want the border to have colors

hey, i wrote this code, the problem is that i only want it’s border to have that color gradient and the background should be black, but when i set the background as black and not transparent it just show black background not the border.

.sign-in-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.sign-in {
  background-color: transparent;
  position: relative;
  padding:  15px 30px;
  color: white;
  cursor: pointer;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  overflow: hidden;
}

.sign-in::before {
  content: '';
  position: absolute;
  top: -5px;  
  bottom: -5px;
  left: -5px;
  right: -5px;
  background: linear-gradient(90deg, #9a4eff, #ce63ff);
  z-index: -1;
  border-radius: 50px;
  transition: transform 0.3s ease;
  transform-origin: left;
  transform: scaleX(1);
}
.sign-in::after {
  content: '';
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: -5px;
  right: -5px;
  background: linear-gradient(90deg, #9a4eff, #ce63ff);
  z-index: -1;
  border-radius: 50px;
  transition: transform 0.3s ease;
  transform: scaleX(0);
  transform-origin: left;
}

.sign-in:hover::after {
  transform: scaleX(1);
}

can you also share your html, and specify which element you are talking about?

html is just a button but here it is

<div class="sign-in-buttons">
        <button class="sign-in">Sign In</button>
        <button class="sign-up">Sign Up</button>
</div>

and what is it the “it” you are talking about here?

i’m talking about the button

can you tell more of what you want to obtain and what issues are you having? what code have you tried?

You know those buttons with a black background, but the text and border have that smooth gradient vibe? That’s what I’m trying to make. But in my case, the whole background’s turning gradient, which I don’t want.

I don’t think I know which buttons you are talking about

you are setting the background to be a gradient

you can take a look here: Gradient Borders in CSS | CSS-Tricks