Тёмный

CSS Before and After pseudo elements explained - part three: as design elements 

Kevin Powell
Подписаться 922 тыс.
Просмотров 160 тыс.
50% 1

Exploring how to use ::before and ::after to create some fun design elements without any extra markup.
The before and after pseudo elements are great, since they let us add in content without any extra markup. This makes them perfect for adding in design flourishes, since we can do it without creating empty divs.
In this video, I first I look at using them to make a fun thing that can be used on headlines, and the second one a very fun hover effect that was inspired from this codrops article: tympanus.net/codrops/2014/06/...
Here is the CodePen: codepen.io/kevinpowell/pen/Zr...
---
New to Sass, or want to step up your game with it? I've got a course just for you: www.kevinpowell.co/learn-sass
---
My Code Editor: VS Code - code.visualstudio.com/
How my browser refreshes when I save: • How to automatically r...
---
Support me on Patreon: / kevinpowell
I'm on some other places on the internet too!
If you'd like a behind the scenes and previews of what's coming up on my RU-vid channel, make sure to follow me on Instagram and Twitter.
Instagram: / kevinpowell.co
Twitter: / kevinjpowell
Codepen: codepen.io/kevinpowell/
Github: github.com/kevin-powell

Опубликовано:

 

27 фев 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 230   
@rafabagrowski1918
@rafabagrowski1918 5 лет назад
Amazing. I watched all 3 parts and immediately solved 6 issues at my job. Instant subscribe ;-)
@KevinPowell
@KevinPowell 5 лет назад
Very awesome, so glad I could help, and thanks for subbing!
@konraddariuszwoloszyn9206
@konraddariuszwoloszyn9206 6 лет назад
As always, Your videos are the top level of professionalism combined with great explanation and a healthy dose of humor. Great job!
@KevinPowell
@KevinPowell 6 лет назад
Thanks so much for the kind words Konrad, really glad you're enjoying my content!
@fersahahmet9597
@fersahahmet9597 5 лет назад
At last I found someone who really knows css and what he is doing. Not mimics some code learnt from some where else. Mr. Powell you ARE a pro. And thank you so much for all the effort putting these video series together
@MrTanguero
@MrTanguero 3 года назад
Loved all three parts of the series and that link you shared also has some amazing ideas! Thanks a lot, Kevin!
@justinpayne6845
@justinpayne6845 5 лет назад
Thank you so much! After watching this series I now know how to make those little notification bubbles RU-vid has telling how many new videos you have and like facebook uses for new posts and such.
@amysheeter877
@amysheeter877 2 года назад
You're the best. Just finished this series, and I was trying to do something similar to this on a website I am currently working on but could NOT figure out how to make it look good. This answered all my questions. Thank you for your amazing work!
@octavian3033
@octavian3033 4 года назад
Wow!! Watching these videos is like having your mind opened to a new CSS multiverse where anything is possible.
@MVIVN
@MVIVN Год назад
I'm still very, very early in my front-end journey but watching stuff like this blows my mind! I can't wait until I get to a point where I am implementing stuff like this into my sites!
@wiecek00
@wiecek00 3 года назад
You are providing really great content Kevin. I started watching your channel and learned a lot of new things as well as solidified my knowledge. Thanks for your help and keep up the good work! I already subscribed :)
@adityads1339
@adityads1339 4 года назад
Watched all 3 videos that were part of the series. Great content! I can confidently say that I understand ::before and ::after, so much better than before. Thank you so much!!!
@nerozone84
@nerozone84 3 года назад
Your videos are great. I just watch any video you have randomly and find a solution to a problem I have in a design. Like in this video, I didn't realise I had to go set box-sizing on before and after psuedo elements. I was wondering why a psuedo element I had wasn't quite lining up the way I expected. Thanks!
@mo3ad96
@mo3ad96 5 лет назад
As always, Your videos are the top level of professionalism thank you so much
@tontonsan3534
@tontonsan3534 5 лет назад
As a beginner, no online course was really explaining what you could do with ::before and ::after and I always thought "I'll get back to it later". Well, I finally took the plunge after your video appeared in my recommended autoplay after watching another tutorial, and I just had to leave a comment because you explain so well, and it is now so easy for me and I feel like you taught me in 1hour what several days of school would have. Thank you and you got a new subscriber :)!
@KevinPowell
@KevinPowell 5 лет назад
Thanks for the sub Tontonsan, and I'm really glad you like my approach!
@seemsas
@seemsas 6 лет назад
I am more of the backend guy but your videos makes me more and more interested in frontend coding. Thank you!
@KevinPowell
@KevinPowell 6 лет назад
That's awesome. Backend scares me, lol.
@CliveStephensonCoUkDesigner
@CliveStephensonCoUkDesigner 5 лет назад
Fabulous Kevin, you have a real skill for explaining things
@joeldcanfield_spinhead
@joeldcanfield_spinhead 5 лет назад
Another excellent explanation. I think the reason this isn't used much is because it's all a bit abstract until you see examples. I suspect that as we all get more familiar and see more examples, there'll be ongoing creative use of pseudo elements like this.
@KevinPowell
@KevinPowell 5 лет назад
I almost exclusively use them for design elements. It's actually good from an accessiblity point of view too, rather than adding extra markup that doesn't actually have a purpose other than looking pretty :)
@dyllanmccreary688
@dyllanmccreary688 5 лет назад
Wow. Watching this series i expected to only learn about ::before and ::after pseudo elements. not only did i learn that but you helped me fix a few issues i was stuck on. thanks guy, great videos.
@KevinPowell
@KevinPowell 5 лет назад
Very awesome, glad it helped Dyllan!
@philkewley
@philkewley 2 года назад
I had an idea replace a blocky looking footer section with a simple text based section, but that meant finding a way to separate content without using background colours or images - I've watched this video so many times over the years without fully understanding how I could use it. And now today when I needed inspiration and direction I remembered it! So I follow everything on the video and place a 50% height before & after behind h3 text, set the after color to transparent, reduce the height to 50%, give it a 3px border-top and push it down using vh, until I've basically got a horizontal rule with the brand name nicely centred. I even managed to place it all in a centred container so it only takes up 90% width. It looks a lot better than that messy description - Honestly I can't thank you enough for sharing so much knowledge, your teaching keeps me going forwards. Thank you
@marikabasagoitia6828
@marikabasagoitia6828 2 года назад
Thank you so much for this! This really cleared up before and after pseudo elements for me and helped create a really cool effect on a page I’ve been working on.
@insaneviruss
@insaneviruss 5 лет назад
Really enjoyed the video, the pacing and your entire thought process. *First timer on the channel* *subscribed*
@KevinPowell
@KevinPowell 5 лет назад
So glad that you enjoyed it so much, and a big thank you for the sub :)
@sravant
@sravant 7 месяцев назад
Your channel deserve 10 million subscribers. Thanks for all the videos Kevin.
@jenniferward6821
@jenniferward6821 3 года назад
Thanks Kevin watched all three and lights went on!
@travisbburch
@travisbburch 4 года назад
this was fantastic - can't wait to watch your other videos
@ricard112
@ricard112 5 лет назад
These videos are gold. Thank you for sharing.
@kristianulvund4274
@kristianulvund4274 4 года назад
Awesome, Kevin🤩 CSS is so much fun!
@360theosiris
@360theosiris 2 года назад
This stuff is amazing and completely changed my view on what is possible with just css.. Thanks for this! Subscribed
@shashankdasaniya
@shashankdasaniya 6 лет назад
This is really a great learning for me,from watching your videos. Thumbs up !
@ilhambagirov571
@ilhambagirov571 2 года назад
Ohh God. Finally i found someone who could explain me what these elements do. Thanks a lot for giving this valuable knowledge to us. 👍🙏
@aminedrouche5465
@aminedrouche5465 2 года назад
You got my brain working 😂 i was thinking with you along the video to find out how to do it. Awesomeness is a fact 😍😍 thank you
@jeffjarvis222
@jeffjarvis222 4 года назад
I enjoy your videos. A super-easy way to style the .intro class "Generic Heading" is with grid using grid-template-columns: 1fr auto 1fr. (I learned this by watching your videos about grid, heh). Add a small grid-gap for white space around the text. Now the ::before and ::after elements just need background color and you're done! Keep up the excellent work, Kevin.
@santiagocalvo
@santiagocalvo 3 года назад
im learning CSS and your channel is the BEST!!! thnx a lot!!!
@MroMroMarc
@MroMroMarc 3 года назад
Man! Im speechless! This is so fun and useful! Ive already said that but you are a great instructor. I wish I could afford some monetary gratification like buying your course. I will, someday soon. For now, thank you very much.
@bpavanellic
@bpavanellic Год назад
Kevin, realy thank u for this series of videos. Love from Brasil .
@jeffdunham541
@jeffdunham541 Год назад
These videos are GREAT! Thank you so much for sharing.
@riyazahamed5378
@riyazahamed5378 3 года назад
Wow, ::before watching this video i assumed that i know something about css, but ::after i realized i am doing css in a wrong way, Thank you Sir (immediately subscribed )
@daniamsalem
@daniamsalem 4 года назад
This is a fantastic video, upping my skills and code cleanliness.
@tilakmadichettitheappdeveloper
@tilakmadichettitheappdeveloper 4 года назад
I watched all 3 parts - this is so cool !
@kelvinsmith4894
@kelvinsmith4894 5 лет назад
Watched the complete 3 parts on TV, had to grab my laptop to comment, like and subscribe!!! Thank you Kevin...
@KevinPowell
@KevinPowell 5 лет назад
Thanks so much Kelvin, glad you liked it enough to take the time to do that! Thanks for the sub :D
@danielkim4487
@danielkim4487 5 лет назад
Really cool. thanks for the lesson Kevin!
@vijais5692
@vijais5692 4 года назад
You are my all time favourite instructor in youtube ❤❤❤❤❤
@herveboulangue6051
@herveboulangue6051 6 лет назад
Thank you Kevin. Love your tips !!! Very usefull and clear as usual :)
@karstenlehmann13595
@karstenlehmann13595 2 года назад
Thanks a lot for these three videos!
@johnthiongo4305
@johnthiongo4305 3 года назад
I have a new found respect for css thanks to you
@SothearithKONGMrMuyKhmer
@SothearithKONGMrMuyKhmer 3 года назад
Thanks Kevin; that’s amazing! 👏👍
@cyndikirkpatrick7578
@cyndikirkpatrick7578 5 лет назад
I sure have learned a lot from you. Thank you.
@akinyemiolalekan1681
@akinyemiolalekan1681 3 года назад
This is simply awesome.....Great job...
@yoSn4p
@yoSn4p Год назад
Thank you master, all explained clearly!!
@lucadifazio2735
@lucadifazio2735 3 года назад
Awesome. This is incredible
@keithho5335
@keithho5335 4 года назад
just found your channel. IM HOOKED
@inayathkhan100
@inayathkhan100 5 лет назад
Great Tutorial Kevin
@jimdart8219
@jimdart8219 6 лет назад
Kevin, once again thank-you for the details on how all this works and why. Just had a thought (it happens now and then). Have you ever considered explaining the planning stages for building a website. What goes on before we hit exclamation tab.Thanks again Kevin, you have raised my ability 10 fold.
@KevinPowell
@KevinPowell 6 лет назад
I sort of talked about it once very briefly in one of my other videos, but I am about to start redesigning my personal site. I'm pretty much in the ideation phase at the moment. I should totally make some videos of what I'm doing and how I'm approaching it.
@mohdsaquib380
@mohdsaquib380 4 года назад
Really loved it. You killed it ✌️
@22D011AROCKIAVIMALJAPSONA
@22D011AROCKIAVIMALJAPSONA 6 месяцев назад
For these kind of effects, outline - offset with some transitions also cool.👍👍
@brandonv8525
@brandonv8525 2 года назад
Your videos are pretty good, I speak Spanish but I better understand your videos than the other videos in my language
@jijiwaiwai
@jijiwaiwai 4 года назад
Thank you! I learned a lot
@Swiftrunner10123
@Swiftrunner10123 3 года назад
You are incredible! Thank you so much!
@maheshbeeravelli
@maheshbeeravelli 6 лет назад
Awesome content worth watching. How did I miss to watch this content before.
@KevinPowell
@KevinPowell 6 лет назад
Glad you're liking it 😁
@maheshbeeravelli
@maheshbeeravelli 6 лет назад
Kevin Powell shared with all my peers (y)
@ya-juchang5099
@ya-juchang5099 5 лет назад
Thank you so much! That is amazing and you are definitely a good teacher!
@KevinPowell
@KevinPowell 5 лет назад
Thanks a lot, glad that you liked the video :D
@pettgree
@pettgree 4 года назад
dudes, CSS seems awesome after this tutorial 🤣 Thanks Kevin
@duke1sanj1
@duke1sanj1 6 лет назад
Excellent as always 👍👍👍
@KevinPowell
@KevinPowell 6 лет назад
Thanks Sanjay!
@zt.5677
@zt.5677 4 года назад
Good material. Thank you.
@alainstross3108
@alainstross3108 Год назад
Kevin, you're a boss
@soumya_r_mohanty
@soumya_r_mohanty 5 лет назад
Excellent explanation Kevin. Could you please explain more about how .card::before goes behind image without setting any z-index on it.
@anishjoshi1999
@anishjoshi1999 Год назад
This man a legend
@redisick
@redisick Год назад
This is so cool!
@thuanle9444
@thuanle9444 5 лет назад
Thanks @Kevin.
@BenRogersWPG
@BenRogersWPG 2 года назад
Outstanding
@hachij_
@hachij_ 6 лет назад
thanks for the tuts sir! :D
@pagarevijayy
@pagarevijayy 3 года назад
this is awesome!
@mahdijafaree5332
@mahdijafaree5332 2 года назад
Awesome! You are Perfect! thanks!😃
@osmbj1377
@osmbj1377 3 года назад
Awesome, thanks
@andersonhall08
@andersonhall08 5 лет назад
subscribed... these are great videos, man. Thanks!
@KevinPowell
@KevinPowell 5 лет назад
Thanks so much for the sub Andy! So glad to hear that you're enjoying my videos!
@melbournemeliodas215
@melbournemeliodas215 5 лет назад
Phew, Exam secured! Thank you Kevin Powell! Im going to watch all of your series after my Exam, but can I ask if you have like a playlist?
@KevinPowell
@KevinPowell 5 лет назад
I have a bunch of playlists :)
@arya_bakh
@arya_bakh 4 года назад
Great Job bro
@tomnagy2439
@tomnagy2439 3 года назад
Great stuff !
@KevinPowell
@KevinPowell 3 года назад
Thanks so much!
@dre429
@dre429 Год назад
Thank you so much!
@rasul3d
@rasul3d Год назад
I like using before and after as a nice colorful thick underline that is 30% of the width of content.
@juhandvan
@juhandvan 6 лет назад
Amazing !
@huzaifarasheed2313
@huzaifarasheed2313 3 года назад
Great video
@OmarAshrafBombo
@OmarAshrafBombo 3 года назад
You are the one man ✌🏼 thank U
@JustJordano
@JustJordano 3 года назад
Tank you, you really helped me there.
@sobeidalagrange7129
@sobeidalagrange7129 5 лет назад
So clear!!! :)
@shimphillip
@shimphillip 5 лет назад
Good job. Your videos are superb.
@KevinPowell
@KevinPowell 5 лет назад
Thanks Phillip!
@marjan5170
@marjan5170 2 года назад
Thank you for this 🤩🤩🤩🤩🤩
@TheSETJ
@TheSETJ 6 лет назад
I can only say: Amazing!
@KevinPowell
@KevinPowell 6 лет назад
Glad you liked it :)
@lildreamsone
@lildreamsone 6 лет назад
Superbe ! merci pour tout
@KevinPowell
@KevinPowell 6 лет назад
Pas de problems 😁
@georgeliss4015
@georgeliss4015 6 лет назад
Thank you!
@KevinPowell
@KevinPowell 6 лет назад
No problem 😀
@kamaboko1
@kamaboko1 6 лет назад
Delicious. Great videos.
@zakirhossain4876
@zakirhossain4876 5 лет назад
Nice tutorial. Thanks a lot.
@KevinPowell
@KevinPowell 5 лет назад
Glad that you enjoyed it :)
@ILTECHS
@ILTECHS 6 лет назад
Nice video. Very good work.
@KevinPowell
@KevinPowell 6 лет назад
Thanks!
@milanm6538
@milanm6538 6 лет назад
Thank you, sir!
@KevinPowell
@KevinPowell 6 лет назад
No problem Milan :D
@honeymoan10
@honeymoan10 6 лет назад
Sick vid!
@KevinPowell
@KevinPowell 6 лет назад
Thanks!
@peekaboo6026
@peekaboo6026 3 года назад
I can't thank you enough.
@user-mo3cw6go7c
@user-mo3cw6go7c 6 лет назад
tank you vary maatch
@colindante5164
@colindante5164 3 года назад
One of the most overlooked selectors to overcome glitches when working will rollovers. In this presentation (referring to the codepen) its .card:hover .card__text {opacity: 1;} This will target Any element with a class name of 'card_text' that descends from an element that is hovered on with a class name 'card' .
@eminaliyev4953
@eminaliyev4953 4 года назад
Thank you so much
@killDJuice
@killDJuice 6 лет назад
I am so glad i found you😂😅
@carolmckay5152
@carolmckay5152 5 лет назад
Groovy!
@benyamin4634
@benyamin4634 2 года назад
i will really be gladful if you put an extra pen for the initial codes so i can code along with you . it becomes really difficul to remove that extra code then write it again along with you . thanks for your wonderful tutorials :3
@chaudhary3394
@chaudhary3394 5 лет назад
Awesome... Your genius
@KevinPowell
@KevinPowell 5 лет назад
Thanks :D