CSS Button Gradient Border

Publicado el: 21 agosto 2024
en el canal de: CodeMentor
3,096
200

Read more here: 👇

👉 The default CSS border property accepts only solid colors, you cannot provide a gradient there

👉 There is also a property called border-image but it is not compatible with border radius

So to fix this, a common solution is to use pseudo elements like this example. We have the after pseudo element for the foreground and the before pseudo element for the background.

The before element has the linear gradient as the background, and on hovering, we scale it to reveal the gradient as a kind of border

⚠️ One drawback is that the scaling is not even, so the border would appear thinner in the longer side and thicker in the shorter side

#css
#csstricks
#frontend
#webdesign
#javascript
#html
#coding
#programming
#reactjs
#vuejs


En esta página del sitio puede ver el video en línea CSS Button Gradient Border de Duración hora minuto segunda en buena calidad , que subió el usuario CodeMentor 21 agosto 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 3,096 veces y le gustó 200 a los espectadores. Disfruta viendo!