How to create a GRADIENT BORDER in CSS Tutorial
ฝัง
- เผยแพร่เมื่อ 18 ต.ค. 2024
- 👉 Get the best web hosting to deploy your websites: www.hostinger....
✌️ Use our discount code CODING2GO to get 10% off on all web hosting packages with a duration of 12 months or more
In this HTML and CSS Tutorial you will learn how to apply a gradient to a border and how to create a glow gradient hover effect with the box-shadow property. This modern CSS button design can be implemented on any website you want. Since it is not possible to use the linear-gradient() method on the border property or the box-shadow, we are going to use a ::after pseudo-element to create the gradient border.
👉 Get our HTML5 Course on Udemy: www.udemy.com/...
#webdevelopment #csshovereffect #csstutorial
Contents of this video:
How to create a gradient border in css
How to use the ::after pseudo-element in css
How to use the linear-gradient method in css
How to create a button hover effect
How to create a glow effect in css
How to apply a gradient to a shadow in css
👍 Like and Subscribe if you enjoyed the video 😉
The work is awesome ❤ nice work bro❤
I made gradient button in c++
Thats a flex
@@ginger8682 yes
😂
@@sanataniengineer4074 what ?
YOU WHAA💀💀💀💀💀
Thanks for making this video 👍👍
level ustad g
Thank Sir❤
it worked on my computer but not on my laptop,but still thx for the vid
Very well explained
nice work man
perfect explanation thx
i did the same thing but it is not showing my border image why?
Me too. I solved, maybe the button is on a navbar whit a “relative” position on the “absolute” position of the “after::button”. So, i solved by putting the navbar at z-index: 1 and leave the “after::button” at z-index -1.
3:08 can somebody explain when we set the z-index to zero in the hover part why the text wasn't covered by the pseudo element?
I would like to know its why too
rel
I was having conflict with transform: translate(). After deleting it and using another method it was working
@Programming-m5t when : :before or : : after pseudo-element is on top of the button it does not work as we expect it to, it does not hide the text inside of the button , the text always stay on top (I am only talking about the pseudo elements mentioned, I don't know how others work).
stacking context
thank you for sharing your valuable information.. please do more videos on CSS bro. we want to learn.
It would be really great if u could share the source code so that we can take a look at it
can u make it transparent ? i mean the bg transparent
Just FYI to everyone, magic numbering the width and height is a pretty bad solution and you would need different magic numbers for every button. If there is more text in the button it will be wider and give you more border on the x axis, so you'll have to lower your magic number.
A much... much better approach is to use negative margin,
button::after{
content: '';
position: absolute;
inset: 0;
margin: -0.2rem;
border-radius: 1000px;
background-image: linear-gradient(to bottom right, #008cff, #e100ff);
z-index: -1;
}
this button will have the same border thickness, no matter how tall or wide the button is.
instead of width and height of 100% btw, just use inset: 0, it means the same thing but is less code.
also with inset: 0, you dont need to make the button a display flex or set the justify center or align items
this is actually extremely helpful, thank you.
Subscribed👍
Very good keep going
I didn't understand the z-index of 0 please
But it's an awesome video
It's ezy
When ever you hover z index-1 will turn into z index- 0
@@TALOB123 the z index of the button is already 0, in the video the z index of the PSEUDO element is set to -1. To noumbissistael's point, that is super confusing and why setting the index of the button to 0 is not explained at all in the video. The reason it works is probably because setting z index to any value creates a new stacking context, even though you're setting it from 0 to 0.
thanks
hey legs be friends in coding
How can we do transition with gradient?
Done it 🎉
Simple ✅✅🙏
Can u use transition 0.5 or doesn't work
👌👌🔥🔥
Moreeeee❤
why doing this when u can do border image?
cool af