Understand CSS Mask in 4 Minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

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

  • @cjmaaz
    @cjmaaz 5 ปีที่แล้ว +37

    Sometimes TH-cam recommendations make me happy. I got to know about an amazing channel today.

  • @elhamuddin.mahmoodi
    @elhamuddin.mahmoodi 5 ปีที่แล้ว +82

    It’s a white stapler by the way

  • @rudethunder6640
    @rudethunder6640 4 ปีที่แล้ว +14

    I think it's all about "z-index" css property

    • @mateuszabramek7015
      @mateuszabramek7015 4 ปีที่แล้ว +1

      @Mr X it could be and browser support would be better.

  • @chukwudiedupractical2173
    @chukwudiedupractical2173 3 ปีที่แล้ว

    I just like your voice...it's just calming 😌

  • @destino1930
    @destino1930 4 ปีที่แล้ว +6

    it doesnt seem to work for me. i did just as you showed in the video but the mask just covers up the headline and i dont know how to fix it...

    • @serjmarkelov9915
      @serjmarkelov9915 4 ปีที่แล้ว +1

      Check z-index property
      And if you set it already, then check that element - it's suppose to have position:relative/fixed/absolute

    • @antjestiller9846
      @antjestiller9846 3 ปีที่แล้ว

      @@serjmarkelov9915 I have the same Problem. I tried playing with the z-index...still...I cannot fix it. Any suggestion?

    • @serjmarkelov9915
      @serjmarkelov9915 3 ปีที่แล้ว

      @@antjestiller9846 what is "position" property of the element that you're trying to z-index?

    • @brettwainscott1165
      @brettwainscott1165 3 ปีที่แล้ว

      Same Problem here. Has anyone found a solution?

    • @antjestiller9846
      @antjestiller9846 3 ปีที่แล้ว

      @Red Stapler any chance you can help out with this. I have not figured it out yet.

  • @creative216
    @creative216 5 ปีที่แล้ว +5

    Amazing job! So so helpful! I enjoy the work you’re doing and your tutorials are great and allow the viewers to build on top of them!

  • @whateverlulz9215
    @whateverlulz9215 2 ปีที่แล้ว

    can you just make it with z-index?

  • @guillermomazzari4983
    @guillermomazzari4983 2 ปีที่แล้ว

    how do I do this if I dont have photoshop?

  • @bubbagee4853
    @bubbagee4853 5 ปีที่แล้ว +1

    So amazing yet so simple as well

  • @stevePurvis1
    @stevePurvis1 4 ปีที่แล้ว

    Thank you, You make really great tutorials.

  • @dvirhanum9530
    @dvirhanum9530 4 ปีที่แล้ว

    Why to use svg in the first place? What are the advantages?

  • @manelariapala8182
    @manelariapala8182 5 ปีที่แล้ว +1

    Hi can this be scalable for a responsive background?

  • @NavyCuda
    @NavyCuda 2 ปีที่แล้ว

    Do you have anything on a number of elements sharing the same background image so that they're all aligned to the same position? I have a nav bar in a header, the header has a background image, the nav bar has a background color and is on top of the header. When I hover on a link, I want the link to show the background from the header, in the correct orientation.

  • @Alex-hm3uk
    @Alex-hm3uk 5 ปีที่แล้ว +2

    Why need mask? Png + Z-index

    • @RedStapler_channel
      @RedStapler_channel  5 ปีที่แล้ว +2

      Good question. The advantage of CSS mask is:
      1) Both methods need to load 2 images. But mask image size is much smaller (significantly if it's svg)
      2) Mask actually "clip" html element to any shape while z-index method just position itself on top. This means you can't select or interact with the element underneath it.
      3) z-index method will mostly need to rely on absolute position which might be difficult for some page structure
      However, the huge disadvantage is browser support as mask doesn't work on IE :)

  • @AdrianTschubarov
    @AdrianTschubarov ปีที่แล้ว

    Why you just dont use z-index?

  • @scooble
    @scooble 4 ปีที่แล้ว

    How do you make a graduated mask which fades the opacity either from opaque to transparent or vice versa?

  • @stevedossin4926
    @stevedossin4926 5 ปีที่แล้ว

    Real nice and simple tutorial. Thanks !!

  • @teoiu7821
    @teoiu7821 ปีที่แล้ว

    the mask ends up covering the headline , anyone know how to fix it ?

  • @lemasch01
    @lemasch01 4 ปีที่แล้ว

    Really cool! Thank you very much! Is it also like this in Firefox? Or how do I make this for Firefox?

  • @gaganmanjunath5917
    @gaganmanjunath5917 3 ปีที่แล้ว

    I’m getting a CORS policy error in chrome

  •  3 ปีที่แล้ว

    simply, it's 2 layers of imgs that stay from below and above of the text @@

  • @elliemay1748
    @elliemay1748 4 ปีที่แล้ว

    The same thing can be made without mask, what is this useful for?

    • @RedStapler_channel
      @RedStapler_channel  4 ปีที่แล้ว

      scalability, faster loading time, svg path can also be animated/modify with javascript for dynamic mask.

  • @albertmontagutcasero2129
    @albertmontagutcasero2129 4 ปีที่แล้ว

    min 3:00 start the mask

  • @pashka3k
    @pashka3k 5 ปีที่แล้ว +1

    Amazing! Like your tutorials

  • @akashfunde
    @akashfunde 5 ปีที่แล้ว

    Which code editor are you using ?

  • @LinOGGaming
    @LinOGGaming 5 ปีที่แล้ว

    Wow amazing video!

  • @ionescumihail41
    @ionescumihail41 4 ปีที่แล้ว +1

    Man , you know what would be cool to create ?
    A video tutorial that when you explain when you hover the mouse over a building it goes up if you know what i mean , subscribe and liked your videos , good work i see you have lot of experience !!

    • @skyleradd1485
      @skyleradd1485 4 ปีที่แล้ว

      Ionescu Mihail I would love that

    • @DiegoAlencar8
      @DiegoAlencar8 4 ปีที่แล้ว

      If i understood it right, it would be better to create a photo montage mixing several building photos and several layers of sea of clouds, maybe done with custom photoshop brushes, and then export each one separated as png transparent.
      Then, it would be necessary to set the position of each one inside the html, setting the z-index correctly and animating it with a class to change the position of it when hover (using transition property). With javascript, would be necessary to set a mouse over event for every building which would toggle the class that animates the building position.
      Maybe it's not the best approach cause of the total weight of images it would create. Maybe using the canvas tag and load images inside with ajax requests... don't know, It's something to think about...

  • @RockstahRolln
    @RockstahRolln 5 ปีที่แล้ว

    Really amazing!!

  • @alfchlopecki7673
    @alfchlopecki7673 5 ปีที่แล้ว

    Great job.

  • @jerryjeremy4038
    @jerryjeremy4038 4 ปีที่แล้ว

    As always, genuis

  • @suryadisamudra8097
    @suryadisamudra8097 5 ปีที่แล้ว

    Simply Tutorial.. great

  • @noorm8380
    @noorm8380 5 ปีที่แล้ว +1

    It is a white stapler on a red background 😂

    • @noorm8380
      @noorm8380 5 ปีที่แล้ว

      Or rather "The Missing Red Stapler"

  • @99danwil
    @99danwil 3 ปีที่แล้ว

    go bang iwan go bang iwan

  • @kaychen4996
    @kaychen4996 4 ปีที่แล้ว

    I thik maybe this tutorial is too simple for most subscribers :D

    • @jamesthedude6927
      @jamesthedude6927 4 ปีที่แล้ว

      until chrome doesn't want to work xD

  • @theMadZakuPilot
    @theMadZakuPilot 5 ปีที่แล้ว

    Awesome

  • @anfas184
    @anfas184 3 ปีที่แล้ว

    fantaste !!!

  • @mariolopes6262
    @mariolopes6262 5 ปีที่แล้ว +1

    Muito legal!

  • @playstore-so2xm
    @playstore-so2xm 5 ปีที่แล้ว

    Great fan of your art and tips&tricks.
    However, I have a wish. Sir, Could you please make a tutorial playlist on Wordpress for making an E-commerce website and deploying it or making a basic photoshop tutorial? Please fulfill my wish. I am your regular viewer and subscriber.

    • @RedStapler_channel
      @RedStapler_channel  5 ปีที่แล้ว

      building an ecommerce website is not a mere simple tutorial. this involve all levels of dev stacks. Despite worked on some projects myself, I have to admit I'm not confident enough to create a tutorial. It will do more harm than good :)

  • @TheAngerman77
    @TheAngerman77 4 ปีที่แล้ว

    Dope

  • @msvmanikantasrivishnu7788
    @msvmanikantasrivishnu7788 5 ปีที่แล้ว

    Super

  •  5 ปีที่แล้ว +1

    Genio!!

  • @h.nazmulhassanrakib5058
    @h.nazmulhassanrakib5058 2 ปีที่แล้ว

    didn't understand anything. you are doing quickly and didn't explain what the result after applied mask.

  • @furbi963
    @furbi963 5 ปีที่แล้ว

    Tus tutoriales siempre tan buenos, saludos (. ❛ ᴗ ❛.)

  • @jamesthedude6927
    @jamesthedude6927 4 ปีที่แล้ว +1

    and OFCOURSE chrome just won't work with it, F you Google xD

  • @dream_boy_
    @dream_boy_ 5 ปีที่แล้ว

    1 st viewer

  • @fahd4007
    @fahd4007 4 ปีที่แล้ว

    this is not mask
    its overlapping

  • @ayushkarir5377
    @ayushkarir5377 5 ปีที่แล้ว

    You could have it positioned absolute

  • @DevMoSofi
    @DevMoSofi 5 ปีที่แล้ว

    Awesome