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 😉

ความคิดเห็น • 55

  • @NisarFoodShow
    @NisarFoodShow 8 หลายเดือนก่อน +2

    The work is awesome ❤ nice work bro❤

  • @SB-wn3gl
    @SB-wn3gl 3 หลายเดือนก่อน +19

    I made gradient button in c++

    • @ginger8682
      @ginger8682 3 หลายเดือนก่อน

      Thats a flex

    • @SB-wn3gl
      @SB-wn3gl 3 หลายเดือนก่อน

      @@ginger8682 yes

    • @sanataniengineer4074
      @sanataniengineer4074 3 หลายเดือนก่อน

      😂

    • @SB-wn3gl
      @SB-wn3gl 3 หลายเดือนก่อน

      @@sanataniengineer4074 what ?

    • @over_kill
      @over_kill 2 หลายเดือนก่อน

      YOU WHAA💀💀💀💀💀

  • @anujchaurasia002
    @anujchaurasia002 4 หลายเดือนก่อน +2

    Thanks for making this video 👍👍

  • @apkcricket2.0
    @apkcricket2.0 2 หลายเดือนก่อน +2

    level ustad g

  • @pyaephyo8108
    @pyaephyo8108 3 หลายเดือนก่อน +1

    Thank Sir❤

  • @ndeyamienjie742
    @ndeyamienjie742 18 วันที่ผ่านมา

    it worked on my computer but not on my laptop,but still thx for the vid

  • @priyanshumalusare8257
    @priyanshumalusare8257 3 หลายเดือนก่อน

    Very well explained

  • @ehabelbrolosy6877
    @ehabelbrolosy6877 2 หลายเดือนก่อน

    nice work man

  • @merictunc
    @merictunc 3 หลายเดือนก่อน

    perfect explanation thx

  • @IslamicReminder486
    @IslamicReminder486 9 วันที่ผ่านมา +4

    i did the same thing but it is not showing my border image why?

    • @Noname-wj7dw
      @Noname-wj7dw 8 วันที่ผ่านมา

      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.

  • @ZAKI-ks1qj
    @ZAKI-ks1qj 2 หลายเดือนก่อน +10

    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?

    • @alimansimov1929
      @alimansimov1929 2 หลายเดือนก่อน

      I would like to know its why too

    • @xoy5
      @xoy5 2 หลายเดือนก่อน

      rel

    • @stephanieapenas1734
      @stephanieapenas1734 2 หลายเดือนก่อน

      I was having conflict with transform: translate(). After deleting it and using another method it was working

    • @serious_17
      @serious_17 หลายเดือนก่อน

      @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).

    • @idohan4513
      @idohan4513 หลายเดือนก่อน

      stacking context

  • @Chaitanya-jc
    @Chaitanya-jc 4 หลายเดือนก่อน

    thank you for sharing your valuable information.. please do more videos on CSS bro. we want to learn.

  • @xa-27-animesh3
    @xa-27-animesh3 2 หลายเดือนก่อน +1

    It would be really great if u could share the source code so that we can take a look at it

  • @oppenheim9406
    @oppenheim9406 10 วันที่ผ่านมา

    can u make it transparent ? i mean the bg transparent

  • @sublimemmNoLink
    @sublimemmNoLink 9 วันที่ผ่านมา +1

    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.

    • @sublimemmNoLink
      @sublimemmNoLink 9 วันที่ผ่านมา +1

      also with inset: 0, you dont need to make the button a display flex or set the justify center or align items

    • @netheritecake
      @netheritecake 7 วันที่ผ่านมา +1

      this is actually extremely helpful, thank you.

  • @spidysense7754
    @spidysense7754 2 หลายเดือนก่อน +1

    Subscribed👍

  • @alimansimov1929
    @alimansimov1929 2 หลายเดือนก่อน

    Very good keep going

  • @noumbissistael1470
    @noumbissistael1470 2 หลายเดือนก่อน +2

    I didn't understand the z-index of 0 please
    But it's an awesome video

    • @TALOB123
      @TALOB123 9 วันที่ผ่านมา

      It's ezy

    • @TALOB123
      @TALOB123 9 วันที่ผ่านมา

      When ever you hover z index-1 will turn into z index- 0

    • @sublimemmNoLink
      @sublimemmNoLink 9 วันที่ผ่านมา

      @@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.

  • @ITSPHERE-ww6mi
    @ITSPHERE-ww6mi 4 หลายเดือนก่อน

    thanks

    • @jeyceejeyka
      @jeyceejeyka 4 หลายเดือนก่อน

      hey legs be friends in coding

  • @mr.k_162
    @mr.k_162 2 หลายเดือนก่อน

    How can we do transition with gradient?

  • @DevoAjit
    @DevoAjit หลายเดือนก่อน

    Done it 🎉

  • @josyafritudemedia551
    @josyafritudemedia551 4 หลายเดือนก่อน

    Simple ✅✅🙏

  • @yamigamer1175
    @yamigamer1175 2 หลายเดือนก่อน

    Can u use transition 0.5 or doesn't work

  • @kaiuniversegames
    @kaiuniversegames 8 หลายเดือนก่อน +1

    👌👌🔥🔥

  • @reanwithkimleng
    @reanwithkimleng 2 หลายเดือนก่อน

    Moreeeee❤

  • @ripisdead8534
    @ripisdead8534 6 วันที่ผ่านมา

    why doing this when u can do border image?

  • @xoy5
    @xoy5 2 หลายเดือนก่อน

    cool af