Это видео недоступно.
Сожалеем об этом.

Understand CSS Mask in 4 Minutes

Поделиться
HTML-код
  • Опубликовано: 4 авг 2024
  • How to use CSS Mask property and example demo to create a parallax text scrolling effect with svg and transparent png mask image.
    Source code: redstapler.co/understand-css-...
    === Follow us on ===
    Facebook: / theredstapler
    Website: redstapler.co/
    Twitter: / redstapler_twit
    #CSS #Mask #WebDesign

Комментарии • 68

  • @cjmaaz
    @cjmaaz 4 года назад +35

    Sometimes RUclips recommendations make me happy. I got to know about an amazing channel today.

  • @elhamuddin.mahmoodi
    @elhamuddin.mahmoodi 4 года назад +80

    It’s a white stapler by the way

  • @creative216
    @creative216 4 года назад +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!

  • @bubbagee4853
    @bubbagee4853 4 года назад +1

    So amazing yet so simple as well

  • @stevedossin4926
    @stevedossin4926 4 года назад

    Real nice and simple tutorial. Thanks !!

  • @stevePurvis1
    @stevePurvis1 4 года назад

    Thank you, You make really great tutorials.

  • @chukwudiedupractical2173
    @chukwudiedupractical2173 2 года назад

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

  • @RockstahRolln
    @RockstahRolln 4 года назад

    Really amazing!!

  • @LinOGGaming
    @LinOGGaming 4 года назад

    Wow amazing video!

  • @NavySturmGewehr
    @NavySturmGewehr Год назад

    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.

  • @alfchlopecki7673
    @alfchlopecki7673 4 года назад

    Great job.

  • @suryadisamudra8097
    @suryadisamudra8097 4 года назад

    Simply Tutorial.. great

  • @manelariapala8182
    @manelariapala8182 4 года назад +1

    Hi can this be scalable for a responsive background?

  • @pashka3k
    @pashka3k 4 года назад +1

    Amazing! Like your tutorials

  • @jerryjeremy4038
    @jerryjeremy4038 4 года назад

    As always, genuis

  • @mariolopes6262
    @mariolopes6262 4 года назад +1

    Muito legal!

  • @lemasch01
    @lemasch01 3 года назад

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

  •  4 года назад +1

    Genio!!

  • @theMadZakuPilot
    @theMadZakuPilot 4 года назад

    Awesome

  • @TheAngerman77
    @TheAngerman77 4 года назад

    Dope

  • @dvirhanum9530
    @dvirhanum9530 4 года назад

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

  • @msvmanikantasrivishnu7788
    @msvmanikantasrivishnu7788 4 года назад

    Super

  • @rudethunder6640
    @rudethunder6640 4 года назад +13

    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.

  • @furbi963
    @furbi963 4 года назад

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

  • @anfas184
    @anfas184 3 года назад

    fantaste !!!

  • @guillermomazzari4983
    @guillermomazzari4983 2 года назад

    how do I do this if I dont have photoshop?

  • @scooble
    @scooble 3 года назад

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

  • @whateverlulz9215
    @whateverlulz9215 Год назад

    can you just make it with z-index?

  • @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 3 года назад +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.

  • @akashfunde
    @akashfunde 4 года назад

    Which code editor are you using ?

  • @AdrianTschubarov
    @AdrianTschubarov Год назад

    Why you just dont use z-index?

  • @gaganmanjunath5917
    @gaganmanjunath5917 3 года назад

    I’m getting a CORS policy error in chrome

  • @teoiu7821
    @teoiu7821 Год назад

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

  • @Dan-li9qw
    @Dan-li9qw 2 года назад

    go bang iwan go bang iwan

  • @Alex-hm3uk
    @Alex-hm3uk 4 года назад +2

    Why need mask? Png + Z-index

    • @RedStapler_channel
      @RedStapler_channel  4 года назад +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 :)

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

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

  •  3 года назад

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

  • @playstore-so2xm
    @playstore-so2xm 4 года назад

    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  4 года назад

      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 :)

  • @albertmontagutcasero2129
    @albertmontagutcasero2129 3 года назад

    min 3:00 start the mask

  • @dream_boy_
    @dream_boy_ 4 года назад

    1 st viewer

  • @noorm8380
    @noorm8380 4 года назад +1

    It is a white stapler on a red background 😂

    • @noorm8380
      @noorm8380 4 года назад

      Or rather "The Missing Red Stapler"

  • @kaychen4996
    @kaychen4996 4 года назад

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

  • @h.nazmulhassanrakib5058
    @h.nazmulhassanrakib5058 2 года назад

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

  • @ayushkarir5377
    @ayushkarir5377 4 года назад

    You could have it positioned absolute

  • @fahd4007
    @fahd4007 4 года назад

    this is not mask
    its overlapping

  • @jamesthedude6927
    @jamesthedude6927 3 года назад +1

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

  • @DevMoSofi
    @DevMoSofi 4 года назад

    Awesome