Three fun uses for ::before and ::after

Поділитися
Вставка
  • Опубліковано 16 гру 2024

КОМЕНТАРІ • 134

  • @georgewoodman839
    @georgewoodman839 3 роки тому +84

    I seem to learn a new thing with every video, even if it's not what the video is about! I have never used isolation: isolate; before and have always been left with a mess of z-indexing on different elements. This is going to help so much going forward so thank you Kevin

  • @vinnym9479
    @vinnym9479 3 роки тому +26

    OMG I've just covered pseudo selectors today in boot-camp. Your tutorials are life saving Kevin. I mentioned to my tutor today you'd tweeted me a solution to an answer about box sizing & my tutor questioned my source.When your name was mentioned he said ahhh the guru, no arguing with his answer......

  • @DevMadeEasy
    @DevMadeEasy 3 роки тому +13

    Hey Kevin Powell
    {Position: 👑King of CSS}
    ::before and ::after is not an easy thing for beginners, so great content, as always!!!
    I just 💜loved it.
    Thanks for sharing it!🙏

  • @simonswiss
    @simonswiss 3 роки тому +10

    Nice use of the `isolation:isolate` property here! It's always kinda hard to teach with real life examples, and that was a good one 👍

  • @bikinglikebecker
    @bikinglikebecker Рік тому

    hover on the cards with oversizing i like... TY for sharing.. articulated.. you and network chuck are noticeably my favorite so far as I learn from scratch...
    i also really like how @ 10:24 when you blur, the color on the right image in bottom left corner really starts to "glow"(shadow), haven't seen color like that since the 80's & the ski bunny jackets.
    fascinating learning these other things while I get over learning to connect sql to my webpage design for customer application doing a simple delivery scheme.. So far I figure I have to make some tables in the db for taking orders, sending orders & keeping track of orders to their userID(acct)... It's fun learning like getting to know a video game... set goals, save gold.. 8D

  • @gwemula
    @gwemula 3 роки тому +2

    You blew my mind again with these tricks!
    KP, you’re the man!

  • @Rallosz
    @Rallosz 3 роки тому

    You're going to make me look like a genius with all of these tricks in front of my classmates!! Even the small things you do are so useful!

  • @maandesai52
    @maandesai52 3 роки тому +4

    THANKS FOR MAKING SUCH INFORMATIVE VIDEOS KEVIN !!!!!!

  • @T0NYD1CK
    @T0NYD1CK 3 роки тому +1

    Instead of a gradient you could use a drop shadow for the text. Center it, reduce opacity and blur the edges. That way you do not notice it but the text becomes easier to read.

  • @robertzeurunkl8401
    @robertzeurunkl8401 3 роки тому

    1:40 - Keep in mind that for us Premium UA-cam subscribers, your popups do not appear. So, the link in the description is helpful.

  • @vukkulvar9769
    @vukkulvar9769 3 роки тому +1

    You can use a linear-gradient() of translucent black instead of doing weird things with ::after
    You can also use text-shadow to only improve contrast around the text
    background-image allows for multiple images, not just one.

  • @viyanmd118
    @viyanmd118 3 роки тому

    I don’t know if it is you or my personal spy from Apple, but every time I am thinking about css tricks I want to dive deeper in, you are posting a video about one like within a couple of days. I appreciate you man

  • @westernpigeon
    @westernpigeon 3 роки тому

    i was just doing research on ::before and ::after and you posted this. THANK YOU

  • @iDATUS
    @iDATUS 3 роки тому

    I clicked the popup link and got a Kevin before and 3.5 years after. not sure if he was relative, fixed or sticky but he was an absolute on the topic!

  • @chhavimanichoubey9437
    @chhavimanichoubey9437 3 роки тому

    absooooolut ely awesome content, long time ago I really didn't understand the concept of pseudo-classes but after watching your videos I'm in love with the pseudo concept.

  • @ronpalmer7260
    @ronpalmer7260 Рік тому

    I was just watching this for fun but you solved an issue I had with border-radius. I have images in divs with rounded corners and I struggled finding a way to keep the square corner images from showing past the rounded corners. I found a way and made it work but missed one and needed to fix it. This overflow: hidden solved the issue easily. I have yet to master the overflow feature but this trick is nice.

  • @chriskasatka2095
    @chriskasatka2095 3 роки тому

    CSS Tricks and Kevin are the GODS of CSS.

  • @vasyaqwe2087
    @vasyaqwe2087 2 роки тому

    I keep coming back here, this video is so helpful. Thanks, best teacher

  • @Darkray201
    @Darkray201 3 роки тому +1

    Wow that were some great tips! Nice doubletime at the end 😂😂 Have a nice weekend, Kevin 😊👍

  • @benja-min1588
    @benja-min1588 3 роки тому +4

    Thank you Kevin! How about some tips on content: openquote, content: attr() and content:counter(). I found these super helpful recently and wish I knew them years ago! Keep it up man.

    • @rickardelimaa
      @rickardelimaa 3 роки тому

      attr() is super handy, but I wished I could use it on more than just `content`. Sure, I can style using [attribute="something"], but it would be nice to be able to use something like `color: attr(data-color)`.

    • @KevinPowell
      @KevinPowell  3 роки тому +1

      I talked about open and close quote not too long ago, and I've done a deep dive on counters in one of my videos in my ::before and ::after series :). Not sure if I've touched on attr() though... 🤔

    • @benja-min1588
      @benja-min1588 3 роки тому

      @@KevinPowell I must have missed those, my fault!

  • @capellaguitar
    @capellaguitar 3 роки тому

    Man, you're just amazing! I've been learning so many new things thanks to you, so: thank you! Cheers from Rio!

  • @AaronGrogg
    @AaronGrogg 3 роки тому

    Love the filter: blur(), especially for the :hover!! :-)

  • @zachjensz
    @zachjensz 3 роки тому +7

    Ah yes, text is the king of css

  • @passioncorners
    @passioncorners 3 роки тому

    Always learning something new with Kevin !

  • @truvc
    @truvc 3 роки тому

    `isolation: isolate`!! I'd never seen that before. Love it!

  • @CarAudioInc
    @CarAudioInc 3 роки тому

    you production quality looking fire!

  • @LorenHelgeson
    @LorenHelgeson 3 роки тому

    Thanks for this. A big fan of these two pseudo elements, and always looking to do more with them.

  • @bySterling
    @bySterling 2 роки тому

    Fantastic tips and styles!! Thank you KP sir 🙌🏻

  • @genesdada7045
    @genesdada7045 Рік тому

    wow! men powerful css tips (mix-blend )mode beautiful sir.

  • @giocaonguyen
    @giocaonguyen 3 роки тому

    Isolation is really cool. I'd never known it before. Thank you!

  • @HuoShengChiou
    @HuoShengChiou 3 роки тому

    Thanks for sharing. For the latest point, I may use multiple line box-shadow setting to achieve. But you give me another road to go. I think the gradient border card is also the interesting task for this part :)

  • @GauravKumar-ue7nz
    @GauravKumar-ue7nz 3 роки тому

    Thank you Kevin 😃, Last one was Coolest.

  • @shivansh901
    @shivansh901 3 роки тому

    Awesome content Kevin, thanks a lot.. that gradient border looks so awesome.. yes I'll steal it 😌

  • @pushkaryadavin
    @pushkaryadavin 3 роки тому

    Came to your channel for the first time. Great content 😊

  • @evanhardek2994
    @evanhardek2994 3 роки тому

    Love the shirt man! Also a very helpful video keep it up!

  • @eliasgarcia1146
    @eliasgarcia1146 3 роки тому

    Hi Kevin, how are you? I am taking your responsive course and tell you that a few days ago (on August 30, my birthday 😋) google chrome supported the "gap" property since in the course you use margin-left because it was not supported yet xD I am finally learning responsive web with that course is excellent. Thank you so much!

  • @simonswiss
    @simonswiss 3 роки тому

    Love the t-shirt! 🤣

  • @ledgentai1227
    @ledgentai1227 3 роки тому

    Brilliant teacher! Thank you Kevin!

  • @truvc
    @truvc 3 роки тому

    if you have `inset:0` you don't need to declare width and height. I love trimming code down to just minimum necessary.

  • @akramdahmani7214
    @akramdahmani7214 3 роки тому

    Great content like usual, you're the GOAT!

  • @minhchau3594
    @minhchau3594 Рік тому

    I love your works, thank you

  • @amirshamekhy767
    @amirshamekhy767 3 роки тому

    Yooohooo king of css new videooo

  • @BeansEnjoyer911
    @BeansEnjoyer911 3 роки тому

    That shirt speaks to me on a level that no shirt ever has

  • @AbhinavKulshreshtha
    @AbhinavKulshreshtha 3 роки тому

    I had no idea what "isolation" was. Now i have to explore it.

  • @evolutionxbox
    @evolutionxbox 3 роки тому

    isolation css is a new one for me

  • @boy3m
    @boy3m 3 роки тому

    I'm glad I stumbled upon your channel. Cool stuff -> subscribed.

  • @imviratpandey
    @imviratpandey 3 роки тому

    U r the best in css love from India 👍

  • @richardkirigaya8254
    @richardkirigaya8254 3 роки тому

    0:55, "Good coders borrow, great coders steal"

  • @alem2988
    @alem2988 3 роки тому

    Absolutely loving your channel, learning so much as a beginner! Do you have a repo/ link to any of your code before you start making adjustments please? Personally find it easier to learn and make changes along side you whilst you explain your thought process and can experience the changes on screen at the same time.

  • @andreaskarz
    @andreaskarz 3 роки тому

    Wow, I love it -- I will checkit out for my next project

  • @sovereignlivingsoul
    @sovereignlivingsoul Рік тому

    good video, i am always fighting to get my images setup properly and i haven't done much with mixed blend mode

  • @_PixelNinja
    @_PixelNinja 3 роки тому

    Hi Kevin, I know it's not the best for legibility, but is there any chance in the future you would touch upon the subject of Neumorphism? Love your videos and thanks for sharing your knowledge!

  • @AlBenChris89
    @AlBenChris89 3 роки тому

    Helpful video, awesome shirt!

  • @johnkeck
    @johnkeck 3 роки тому

    Kevin, *you* are awesome!

  • @2222974Vairus
    @2222974Vairus 3 роки тому +1

    Great video. Now I do not need to edit my images manually with a dark overlay for text visibility.

  • @yashkamath9969
    @yashkamath9969 3 роки тому +1

    hey kevin, i had asked this in the your previous video, pls link ur secondary monitor's wallpaper, the one with the logo thing on it

    • @KevinPowell
      @KevinPowell  3 роки тому

      Oh, never thought of making that public... hrm, I'll look into getting it up :)

    • @yashkamath9969
      @yashkamath9969 3 роки тому

      @@KevinPowell Ohk. By the way love your content 🙂🙂

  • @karsyz
    @karsyz Рік тому

    That shirt is dope!

  • @picool13
    @picool13 3 роки тому

    You have such a great knowledge on CSS and Im watching your videos since 3 years back even joined some of your free courses too. But Im little afraid for you that your channel will not grow as it should be it's because you have very thorough knowledge on the topic and you are putting everything so this makes your videos complexity level very high which target very specific audience.
    I can see you love your work and you are enjoying every bit of it through this channel but above what I said is just a thought which needs to be conveyed to a legitimate person like you. Love you Kevin 😁

  • @PapaG-0101
    @PapaG-0101 3 роки тому

    Wow, Not only school'n people in code but design! That was very informative! Thanks eh!

  • @MeDoGAMERS
    @MeDoGAMERS 3 роки тому

    Basically brilliant!

  • @javierolazaran7227
    @javierolazaran7227 3 роки тому

    Thanks!

  • @henkiet7844
    @henkiet7844 3 роки тому

    Kevin, will you do a video on input type range styling ?

    • @KevinPowell
      @KevinPowell  3 роки тому

      My one from last week would work for changing the color of it. I don't have anything that involves more custom work though.

  • @sonicseaweed
    @sonicseaweed 3 роки тому

    In the last example, why were the box corners sharp when he only had the before element and rounded when he had the before and after elements? 😮

  • @codingchannels4103
    @codingchannels4103 3 роки тому

    With first use case isnt using multiple background much simpler option?

  • @MosDev__
    @MosDev__ 3 роки тому

    love your shirt !

  • @Turabbo
    @Turabbo 3 роки тому

    Fun video dude. Great way to finish a difficult day.
    Any tips on the cool syntax for RGBA? I've wanted to use it, but I'm hesitant because I can't find literally anything on Google about browser support.

    • @KevinPowell
      @KevinPowell  3 роки тому

      Everything except IE - caniuse.com/?search=Space-separated%20functional%20color%20notations

    • @Turabbo
      @Turabbo 3 роки тому

      @@KevinPowell Wow I've never heard of that term before, thank you. 93 percent!

  • @MyDistortedWorld
    @MyDistortedWorld 3 роки тому

    Nice t-shirt dude

  • @wendysburgers4326
    @wendysburgers4326 3 місяці тому

    Hiw to use this when Radio Button click and show specific Div containers

  • @MrSuprashadow
    @MrSuprashadow 3 роки тому

    Wow! Thank you.

  • @andrewrea2799
    @andrewrea2799 3 роки тому

    Super cool 😎 tricks

  • @genesdada7045
    @genesdada7045 Рік тому

    These content its so sweet.

  • @pablosantamaria8246
    @pablosantamaria8246 Рік тому

    Is "Hello my friend and friends" what he says at the beginning of each video?

  • @srgberni
    @srgberni 2 роки тому

    What is the reason of declaring 'inset: 0', isn't it 0 by default?

  • @TobiasBechtleFotograf
    @TobiasBechtleFotograf 3 роки тому

    Very nice, i love the last one what also seems to work with images if they are set to background. But how would you then use the blur only behind the box? Bcs in the gradient u do not see it, but if you use the background you see it clearly that the blur is over the gradient itself. Any ideas?

    • @TobiasBechtleFotograf
      @TobiasBechtleFotograf 3 роки тому

      nvmd, just my removing the isolation of the parent element it goes behind if ut has z-index: -1

  • @shecodes94623
    @shecodes94623 3 роки тому

    you are dope, love your energy... thnaks for the awesome content

  • @savankumar0
    @savankumar0 3 роки тому

    Thanks man 😀👏❤️

  • @melania239
    @melania239 2 роки тому

    I fell in love with Kevin 💕

  • @cryptolicious3738
    @cryptolicious3738 3 роки тому

    so nice! ❤ this video

  • @amandeepchauhan6091
    @amandeepchauhan6091 3 роки тому

    6:00
    CSS wizard is talking about another CSS wizard

  • @commelinales
    @commelinales 2 роки тому

    Thank you

  • @jasurmusaev7234
    @jasurmusaev7234 3 роки тому

    thank you a lot

  • @AlThePal78
    @AlThePal78 3 роки тому

    rgb(/) takes away rgba way that is something new very awesome :)

  • @leomonz
    @leomonz 3 роки тому

    can you do css part, thank you

  • @michelaveline
    @michelaveline 3 роки тому

    Awesome!!!

  • @XxObserver
    @XxObserver 3 роки тому

    "Alright Kids, next lessons i'll show you how to replace Photoshop by using CSS3 pseudo-Elements and a peeled banana." - Kevin Powell

  •  3 роки тому +1

    While it looks fine I find the examples a bit too 'magical' for practical purposes. It makes sense when you have no influence on generated HTML so you use a bunch of CSS to simulate missing elements but I find that is a rare occasion. IMHO its much more practical to just generate additional elements and apply 'normal' CSS to them. It would be interesting if you would provide an additional video where you replicate the effects but where everything is more maintainable and understandable (just an idea).

    • @KevinPowell
      @KevinPowell  3 роки тому +2

      For me, when it comes to the decorative stuff I'm doing here, I find pseudo-elements sooo much more practical than requiring spans or divs with no content in them, and just a class.
      If I want a card that has a gradient background, I want to throw that class on there, and it handles the rest. I've done it a lot with testimonials as well, with the open and closed quotes generated through pseudo-elements as they're often bigger and decorative.
      It takes a bit more work to set up the CSS, but then when you, or a team member, applies the one class, everything comes with it and it just works.

    •  3 роки тому

      @@KevinPowell Thanks for the reply. Keep doing what you do. I love your channel.

  • @atouchofa.d.d.5852
    @atouchofa.d.d.5852 3 роки тому

    Killer shirt!

  • @dancarter6044
    @dancarter6044 3 роки тому

    Wow!

  • @Stoney_Eagle
    @Stoney_Eagle 3 роки тому

    Maybe Merlin and the king should do a colab to make something cool 😉

  • @DenisovichDev
    @DenisovichDev 3 роки тому

    Amazing

  • @NotKyleChicago
    @NotKyleChicago 2 роки тому

    0deg = to top?

  • @MoayadChannel
    @MoayadChannel 3 роки тому +1

    Unfortunately, pseudo elements have rendering issues with iOS

    • @rickardelimaa
      @rickardelimaa 3 роки тому +1

      I only had rendering issues when I used `width: 100%` with `position: absolute`. I needed to use `left: 0` and `right: 0` instead. What kinds of problems did you have?

    • @KevinPowell
      @KevinPowell  3 роки тому +1

      What type of issues? I can't think of any that I've run into 🤔

    • @MoayadChannel
      @MoayadChannel 3 роки тому

      @@KevinPowell I tried to make a layer over the body with ::after and it wasn’t rendered across iOS devices. However, not all pseudo elements have issues.

    • @MoayadChannel
      @MoayadChannel 3 роки тому +1

      @@rickardelimaa I mentioned one here.

  • @atarixle
    @atarixle 3 роки тому

    Last example is not working for me... somehow this all in locked inside the div-container. I bet, like always I will find the solution after I asked, but before I find an answer myself.

    • @atarixle
      @atarixle 3 роки тому

      I found out that in my case this only works with overflow:visible;

  • @mhdfr
    @mhdfr 3 роки тому

    didn't know element can be Isolated too

  • @RobRockTwister
    @RobRockTwister 3 роки тому

    Cool shirt :)

  • @JohnStrandt
    @JohnStrandt 2 роки тому

    Are you Canadian?

  • @kamaboko1
    @kamaboko1 3 роки тому

    Clever shirt message

  • @GlennPhilp
    @GlennPhilp 3 роки тому

    "Stealing stuff from it"? LOL Wow that was harsh.

  • @muhammadsiddiqui2244
    @muhammadsiddiqui2244 3 роки тому

    Hmmm ... so, what I learnt is: This can also be done with CSS.

  • @kestonsmith1354
    @kestonsmith1354 3 роки тому

    I love absolute positioning , relative positioning is not for me .