Тёмный

Creating a layered card with HTML & CSS 

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

🔥Sign up for iCodeThis for free daily challenges, or go for the full shebang and use the coupon code KEVIN (valid until the end of the June) for an extra 10% off their current early-bird pricing: icodethis.com/?ref=kevin (affiliate link, so if you do go for a PRO account, you also help support this channel 🙂)
My friend Florin Pop recently launched a new site with daily UI challenges for you to practice your HTML, CSS, and JavaScript and I thought it would be fun to take on one of the challenges, plus it was a good excuse to play around a little bit with subgrid, which I hadn’t used in awhile.
🔗 Links
✅ iCodeThis: icodethis.com/?ref=kevin (affiliate link)
✅ Windows Power Toys: learn.microsoft.com/en-us/win...
⌚ Timestamps
00:00 - Introduction
00:28 - The challenge that I’m going to be trying
02:00 - Writing the HTML
07:00 - Generic CSS to set the stage
07:40 - Setting up the main grid
10:30 - Using subgrid for the overlap
13:30 - Styling things up to match the challenge
26:46 - Styling the status
35:50 - Styling the button
38:45 - Finishing touches
39:30 - More info about iCodeThis
#css
--
Come hang out with other dev's in my Discord Community
💬 / discord
Keep up to date with everything I'm up to
✉ www.kevinpowell.co/newsletter
Come hang out with me live every Monday on Twitch!
📺 / kevinpowellcss
---
Help support my channel
👨‍🎓 Get a course: www.kevinpowell.co/courses
👕 Buy a shirt: teespring.com/stores/making-t...
💖 Support me on Patreon: / kevinpowell
---
My editor: VS Code - code.visualstudio.com/
---
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.
Twitter: / kevinjpowell
Codepen: codepen.io/kevinpowell/
Github: github.com/kevin-powell
---
And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!

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

 

25 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 93   
@FlorinPop
@FlorinPop Год назад
The CSS GOAT in action! 🎉 Glad to see you gave our platform a go! We just started and have big plans to help developers learn in a fun way! 😁
@CirTap
@CirTap Год назад
...and make a little money on the go with the freemium model 😂 So altruistic.
@KevinPowell
@KevinPowell Год назад
If you tried to sign up and got a rate limiting error, I've talked with Florin and they found the issue and looks like it's been solved, so you can try again now 🙂
@FlorinPop
@FlorinPop Год назад
All fixed! Everyone can signup now, hehe 😁
@jh1154244
@jh1154244 11 месяцев назад
​@@FlorinPopquestion....is 24 hours all you get? I ask because I work, and it wouldn't be enough time for me😩
@CirTap
@CirTap Год назад
Using 'ex' and 'ch' for things like this pill /badge inline padding gives you nice typographic symmetry without guestimating 'rem' fractions or fiddling with .25 steps. A simple start with `padding-inline:1ch` will always look good for any typeface in the element's context font size.
@lunapineapple
@lunapineapple Год назад
Thanks for all the content Kevin! Been going through heaps of it and am falling in love with css!
@stevecrabtree9141
@stevecrabtree9141 Год назад
It was fun to see your workflow. You are the GOAT
@tiloiam
@tiloiam Год назад
Excellent use of subgrid, would love to see more examples of it's use.
@andrewrea2799
@andrewrea2799 Год назад
Would love to see better browser support for subgrid
@sharakpl
@sharakpl Год назад
Grid was an overkill for this. Simple margin and padding would make this work perfectly.
@sideshowlol
@sideshowlol 11 месяцев назад
Yup. I think this a good example of how to over-complicate a straightforward column layout. I think KP should go this again and leave his grid shoes at the door.
@clevermissfox
@clevermissfox 7 месяцев назад
He did say at the beginning he’s been wanting to play with subgrid. Of course it could have been done several different ways but choosing to use grid was a direct result of wanting to work with subgrid.
@santicanog_
@santicanog_ 9 месяцев назад
90deg 🚀 I didn't know most of the content here, but the grid just seems to fits pretty well with any layout 💜
@MdRasel-qb4tx
@MdRasel-qb4tx Год назад
Lots of love sir for giving so much time to work We will get work like this again for our learning
@sergeplaski
@sergeplaski 10 месяцев назад
Subgrid not being supported by Edge is a bummer. Opera too, but that's not as important. Unfortunately, in real world we must stick to a universal solution. Otherwise, it is a great feature, just need to wait for a few years to begin using it in production environments🙂 Kevin, thanks a ton for the great content in the channel!
@kayodesamsonadelola7688
@kayodesamsonadelola7688 Год назад
Thank you❤🔥🔥
@UnknownPlayersRo
@UnknownPlayersRo Год назад
Nice Video Kevin, can you make a video explaining the oklch color space? ❤
@brucewayne4357
@brucewayne4357 Год назад
Hey Kevin, for the start chatting div, why did you use grid over flex?
@GR_BackingTracks
@GR_BackingTracks Год назад
I do enjoy a "i haven't planned this out" demo...
@skkabetu
@skkabetu Год назад
seeing the avatar change every time was quite entertaining
@mahadevovnl
@mahadevovnl Год назад
Bonus points for not using Tailwind! 💜
@mahadevovnl
@mahadevovnl Год назад
​@@jeymen It isn't. It's one big anti-pattern and breaks all good conventions when it comes to DRY (don't repeat yourself), and having reviewed thousands of portfolios and job applicants (including for FAANG companies), I've noticed a trend: 1. Tailwind-lovers tend to not understand CSS. "But it maps to CSS 1:1!!" you might say, sure. Then since I know fuel goes boom, rocket goes weeeeee, now I'm a rocket scientist? TW-lovers don't know CSS, otherwise they would use CSS. 2. Tailwind-lovers tend to spam `div` and not much else far more often than others. 3. Tailwind-lovers tend to not know or understand accessibility and why it matters. 4. Tailwind-lovers tend to also be good software developers, but for some reason are perfectly fine spamming 20+ or even 40+ utility classes onto a SINGLE line of code. Great way to confuse git when you change one utility class. 5. You forego specificity and the "C" part of CSS entirely. 6. You have to use weird-as-hell syntax for grouped pseudo selectors (like :hover). And there's so much more. Tailwind is used by people because they don't understand CSS, and then they claim "but it's practically CSS", not knowing that... they really don't know what they're talking about.
@shahaed
@shahaed Год назад
Yes but general tutorials should be basic css. It should translate to tailwind seamlessly
@parkourbee2
@parkourbee2 Год назад
​@@shahaed To be fair, translating from tailwind to css is just as easy as translating from css to tailwind.
@krazak2863
@krazak2863 Год назад
@@parkourbee2 the point is learning how to do it in pure css is much more valuable in terms of learning. Development and efficiency wise, then you can use tailwind and others. But if you’re trying to learn, pure css is the way to go.
@shahaed
@shahaed Год назад
@@parkourbee2 doesn’t make sense to learn tailwind first since it’s a subset of css. Plus there’s many properties not available in tailwind and using arbitrary values would be confusing in a video like this if you didn’t understand that actually css
@Dorchwoods
@Dorchwoods 10 месяцев назад
Awesome video, love hearing your thought process as you work through UIs. I had a question for you though, I noticed you always use rem values for padding, and even grid-template-column values. Isn't there issues with browser zoom and rem units on padding in particular? Zooming in causes those paddings to grow which can break page layouts. Curious to hear your thoughts on that. I've been taught to use rem on fonts only. Thanks for all the excellent content!!!
@KevinPowell
@KevinPowell 10 месяцев назад
Any unit will grow when the page is zoomed in, other than viewport units, and to me, that's a bigger problem
@cheddadmohammed7861
@cheddadmohammed7861 Год назад
This tutorial makes me more aware of the usage of the grid. Thank you for sharing this. Can I use flex to make the div over float another div without using absolute and relative?
@bn5055
@bn5055 Год назад
You could use transform:translate to move the lower card up over the upper one yes.
@cheddadmohammed7861
@cheddadmohammed7861 Год назад
Thank you, I'll try it when I am on my laptop.❤
@rajaulislamratul4736
@rajaulislamratul4736 Год назад
Do you use eye care monitors or the regular ones?
@daviddiazfernandez637
@daviddiazfernandez637 11 месяцев назад
Where can we find the assets used on the daily challenges? I just signed up and is painful to screenshot and upload somewhere the used images. It would be good to have the svgs or image url available.
@ferbragga
@ferbragga Год назад
I like how the gradient from the challenge is the same gradient behind yourself 😅
@groovebird812
@groovebird812 Год назад
Keep it simple. I would use negative margins for the container at the bottom
@snoowwe
@snoowwe Год назад
hi Kevin, is there a specific reason why you prefer to do grid-column: 2/3 instead of grid-column: 2? Same thing for grid-row 2/4, why not do grid-row: 2 span 2? I'm super rusty on display: grid since I tend to default to flexbox so this was a great video for me
@KevinPowell
@KevinPowell Год назад
Just preference and being more specific, no real benefit compared to the examples you gave
@TrashCoder1
@TrashCoder1 10 месяцев назад
I used position absolute
@TheThirdWorldCitizen
@TheThirdWorldCitizen Год назад
Pseudo element for the status content is clever, but it’s not useful in the real world. What happens if you want to localize your project? You’ll have to go back and change the code. Great content!
@raphaelsanchez1235
@raphaelsanchez1235 Год назад
What tool Kevin use for this video ??
@ambyehigimetor1667
@ambyehigimetor1667 Год назад
What i would want to know is how to achieve this same effect without using subgrid
@tomaszgora4353
@tomaszgora4353 Год назад
Me: This is a fun tutorial to follow. Also me: Just looked up browser support for subgrid....
@zdenekopolzer822
@zdenekopolzer822 Год назад
It will be cool if you make a video about html email template
@mahmoudkhamis7381
@mahmoudkhamis7381 Год назад
Hi Kevin, Great tutorial as usual ♥ is there another solution without using (grid-template-row: subgrid) it works only with Safari 😕
@ripcorddesign
@ripcorddesign Год назад
Yes, you can just create two boxes (divs), then slide the 2nd box up on top using translate. Give the 2nd box a negative margin bottom to bring up the space left below.
@arturosan007
@arturosan007 Год назад
THANK YOU! I thought I was losing my mind. I was following along and got stuck at 11:15 because my code below (using subgrid) wasn't working: .welcome { background: lightblue; grid-column: 1 / -1; grid-row: 1 / 3; display: grid; grid-template-rows: subgrid; grid-template-columns: subgrid; }
@mahmoudkhamis7381
@mahmoudkhamis7381 Год назад
@@arturosan007 never mind bro, you can always check if your browser support this feature or not by in 2 ways 1- in CSS use @support( prop : value ) 2- can I use website
@GalaxCFX
@GalaxCFX Год назад
Is there a site like this for more beginner type people? Asking for a friend..
@mukleshossen751
@mukleshossen751 Год назад
Bro if we use flexbox then what happened?
@Innodeals
@Innodeals Год назад
What should I write in JavaScript when I want my website to be in desktop mode automatically when I open my website in a mobile phone?
@KevinPowell
@KevinPowell Год назад
You could just leave out the I guess... not sure why you'd want to do that though!
@professionalshahbaz8655
@professionalshahbaz8655 Год назад
CSS nesting is here. Please make a video on pure CSS nesting
@KevinPowell
@KevinPowell Год назад
Was going to say I'm waiting for better browser support, but with it in the lastest version of Safari I guess it is time 🙂
@modernkennnern
@modernkennnern Год назад
@@KevinPowell Just checked caniuse, and FF115 has support behind a flag supposedly as well! :)
@Jackie815
@Jackie815 Год назад
What vs code theme are you using? 🤤
@KevinPowell
@KevinPowell Год назад
-Atom One Dark- Edit: I use that in VS Code... This has it's own editor and I have no idea what it is, lol
@jaspreetmaan121
@jaspreetmaan121 Год назад
​@@KevinPowelllooks like cobalt 2
@gfxbh1715
@gfxbh1715 Год назад
Css is now support for nested elements like sass, make a video on this topic
@simoncoupe8294
@simoncoupe8294 Год назад
say please lol
@stevelam1315
@stevelam1315 Год назад
For simplicity, instead of subgrid, why can't I create an empty div between .welcome and .start-chatting divs?
@KevinPowell
@KevinPowell Год назад
I'd much rather a pseudo element than an empty div, of you want to go that route. If it's a one-off for fun, it doesn't matter obviously, but if I was going to have a card like this on a site, using an empty div becomes a pattern you'd very quickly regret.
@stevelam1315
@stevelam1315 Год назад
@@KevinPowell I can add a class name as "blank-empty" and attributes as aria-hidden='true', data-status='important!' to the empty div. Will it cover up all the downfalls of using empty divs in HTML body?
@arturosan007
@arturosan007 Год назад
@@KevinPowell I was following along with a codesandbox but I got stuck at 11:15 because my code didn't achieve the same results/behavior as yours. I'm using Edge as my browser to code within codesandbox. Could that be why it wasn't working? .welcome { background: lightblue; grid-column: 1 / -1; grid-row: 1 / 3; display: grid; grid-template-rows: subgrid; grid-template-columns: subgrid; }
@dibel3669
@dibel3669 8 месяцев назад
​@@arturosan007some things in this code are not supported by Edge, you will have more luck viewing the site in chrome.
@ZigaKrasovec
@ZigaKrasovec 11 месяцев назад
Search history at 5:04 👀
@metcaelfe
@metcaelfe Год назад
Oh hey
@Lets_Code25
@Lets_Code25 Год назад
Wow u viewed my project 2 times😁
@Way_Of_The_Light
@Way_Of_The_Light Год назад
If anyone needs some front end challenges that would be used in a SAAS app let me know. I could use some front end help for my website and I don’t have money to hire someone 😅
@bodepeter2309
@bodepeter2309 Год назад
Subgrid isn't working on chrome
@Tony.Nguyen137
@Tony.Nguyen137 Год назад
I cant find some older videos of you??
@KevinPowell
@KevinPowell Год назад
They should all be there. Which ones are you looking for?
@Tony.Nguyen137
@Tony.Nguyen137 Год назад
@@KevinPowell the one with hover box shadow trick from tobiasahlin, and a front end challenge with the bank card
@outplay3759
@outplay3759 Год назад
your background color is almost the same :d
@Take-the-Ticket
@Take-the-Ticket Год назад
Plot twist: iCodeThis is an AI corporations can rent, that learns from user input. The corporation sends in a picture of what they want, the user trains the AI, and pretty soon POOF bye bye Kevin 🤣 And poof all of us...
@FlorinPop
@FlorinPop Год назад
How did you know? 🤣🤣🤣
@tanmaypanadi1414
@tanmaypanadi1414 11 месяцев назад
someone should take this up with the ai overlords
@ciufciuf6208
@ciufciuf6208 Год назад
5:03
@kennethguinto4862
@kennethguinto4862 Год назад
i kid you not someone watching this be like How can i make this more complicated with React or Vue or Sverlte lol .
@agilkerimov
@agilkerimov Год назад
The first comment
@ModifiedMusicYT
@ModifiedMusicYT Год назад
I think Kevin broke the site, all I get when trying to sign up is `Email rate limit exceeded`
@KevinPowell
@KevinPowell Год назад
Oh no 😅
@mahmoud-bakheet
@mahmoud-bakheet Год назад
subgrid 😂
@KevinPowell
@KevinPowell Год назад
What's wrong with subgrid? Chrome just announced intent to ship, and it's already in FF and Safari
@alexpanteli3651
@alexpanteli3651 Год назад
​@@KevinPowell it's enough to start experimenting with it but not using it on a production site yet
@ApprendreSansNecessite
@ApprendreSansNecessite Год назад
I felt genuinely depressed when I saw this. I hate grid and what people do with it. I know you did this because you wanted a use case for sub-grid but this is so complex and over-engineered for what it is! You just need to have a padding-bottom on .welcome and a negative margin-top on .start-chatting to make the two overlap. It is that simple. The rest is just using variables to keep the white spaces consistent. End of the story.
@justingallant1560
@justingallant1560 Год назад
I am a beginner and I am always looking for ways to improve and I have learned some helpful things from you...but in the interest of full transparency, this video actually made me very discouraged. Such a simple design seems so involved with so many lines of code. To a seasoned developer and for someone who loves this, a tutorial like this might be exciting and rich. But after watching this, it had the exact opposite of what you seem to aim for in your opening statements; to reduce stress. I understand that some layouts cannot avoid complexity, but I found myself saying, if this is what it takes to achieve this basic layout, I dont think this is for me. I am not looking for encouragement or anything like that. Just wanted to provide some feedback.
@Lernschau
@Lernschau Год назад
granted, this might not have been the simplest solution to the problem, but if this already puts you off, then you will probably never make it thru coding a full blown website with literally hundreds of these "simple little designs" that all need to fit together to not blow up. Plus coding interactivity and form handling. That's also what separates pixel pushers and print design from screen and interaction design.
@chrisstucker1813
@chrisstucker1813 Год назад
Don’t worry about it. The reason you’re feeling so discouraged is because this example was so overkill and unnecessary. To make things overlap you can just add padding to the bottom of the top box and negative margin to the top of the bottom box. It’s that simple
Далее
это самое вкусное блюдо
00:12
Просмотров 1,2 млн
The problems with viewport units
13:23
Просмотров 354 тыс.
How to make a nice site with less CSS
18:56
Просмотров 55 тыс.
Avoid these 5 beginner CSS mistakes
21:38
Просмотров 71 тыс.
Flexbox or grid - How to decide?
18:51
Просмотров 703 тыс.
Fade In on Scroll | HTML, CSS & JS Tutorial
4:40
Просмотров 4,8 тыс.
5 simple tips to making responsive layouts the easy way
15:54
Create direction-aware effects using modern CSS
18:30
Login Form using HTML & CSS only.
10:31
Просмотров 2 тыс.