![Dev Dive In](/img/default-banner.jpg)
- 51
- 55 512
Dev Dive In
Canada
เข้าร่วมเมื่อ 22 ส.ค. 2023
Empowering Developers to Build the Web of Tomorrow.
This Should Have Been In CSS Years Ago
Learn how to center content in CSS easily with this simple tutorial. Say goodbye to hacks - this should have been in CSS years ago!
มุมมอง: 34 173
วีดีโอ
How to Setup Up a Component Library with React, Vite, Storybook and Tailwind
มุมมอง 622หลายเดือนก่อน
Unlock the power of React with ease! Dive into the world of component libraries with our step-by-step guide on using Storybook, Vite, and Tailwind CSS. In this comprehensive tutorial, we'll walk you through setting up a robust development environment. Whether you're a seasoned developer or just starting out, this video will equip you with the tools and knowledge to streamline your React compone...
Sign Spinning: JavaScript Buttons That Turn Heads
มุมมอง 4672 หลายเดือนก่อน
In this fun video, we use JavaScript to create a button that spins a sign to get a user's attention. We make use of Rive for the animations and integrate those animations into our site. Github Repo: github.com/dev-divein/sign-spin Try it out: dev-divein.github.io/sign-spin/ Rive Documentation: help.rive.app/runtimes/overview/web-js #Rive animation
JavaScript Hijinks: Mouse Cursors Swarm Your Screen!
มุมมอง 1K3 หลายเดือนก่อน
In this video, we'll create a fun mouse follower using JavaScript and CSS. This effect isn't really meant for production, but instead a fun little project to learn JavaScript concepts. Boid CodePen: codepen.io/devdivein/pen/XWQdypy Boid CodePen: codepen.io/devdivein/pen/rNRgegK Ben Eater Boid Implementation: eater.net/boids Smarter Everyday Boids Episode: th-cam.com/video/4LWmRuB-uNU/w-d-xo.htm...
How to Create an Award-Winning Mouse Follower With JavaScript
มุมมอง 8354 หลายเดือนก่อน
Create an image mouse follower, and have a little fun doing it. In this video, we recreate a mouse follower from an award-winning site. (www.studiosabia.com/) Feel free to fork and share any CodePens. We look forward to seeing what you come up with! Mouse Follower CodePen: codepen.io/devdivein/pen/qBvMava Cat Mouse Follower CodePen: codepen.io/devdivein/pen/KKEJxKp Scared Mouse Follower CodePen...
Make an Award Winning Scroll Effect Using ONLY CSS
มุมมอง 4.1K4 หลายเดือนก่อน
Make an Award Winning Scroll Effect Using ONLY CSS
Silky SMOOOOOTH Effect Using StyleX and React
มุมมอง 1.1K5 หลายเดือนก่อน
Silky SMOOOOOTH Effect Using StyleX and React
Stop Your Code From Stinking: 5 Code Smells
มุมมอง 6876 หลายเดือนก่อน
Stop Your Code From Stinking: 5 Code Smells
How to Create the Holy Grail of Layouts: CSS Grid
มุมมอง 2.3K7 หลายเดือนก่อน
How to Create the Holy Grail of Layouts: CSS Grid
A Step-by-Step Guide to Styling Websites: CSS Made Easy
มุมมอง 2488 หลายเดือนก่อน
A Step-by-Step Guide to Styling Websites: CSS Made Easy
Comparing LARGE Amount of Text? VSCode Tip to Save Time
มุมมอง 248 หลายเดือนก่อน
Comparing LARGE Amount of Text? VSCode Tip to Save Time
HTML Basics: 4 HTML tags you'll use on every website - Part 4
มุมมอง 1328 หลายเดือนก่อน
HTML Basics: 4 HTML tags you'll use on every website - Part 4
HTML Basics: Heading and Paragraph tags - Part 3
มุมมอง 1018 หลายเดือนก่อน
HTML Basics: Heading and Paragraph tags - Part 3
HTML Basics: How to create your first website - Part 2
มุมมอง 8939 หลายเดือนก่อน
HTML Basics: How to create your first website - Part 2
HTML Basics: The First things you need to know to make a website - Part 1
มุมมอง 579 หลายเดือนก่อน
HTML Basics: The First things you need to know to make a website - Part 1
5 Must-Knows for Web Development Beginners
มุมมอง 829 หลายเดือนก่อน
5 Must-Knows for Web Development Beginners
margin: auto; left the chat
Subbed 👍
Wow a new way to center a div... Im sure that one line of code makes an entire difference
great video, didn't know about this feature! in future videos, i'd love it if you quickly covered the browser support for the feature as well
Thats insane
So we finally got something equivalent to the center HTML tag. Hate on it all you want but it was effective and CSS dragged its feet on implementing anything equivalent in simplicity.
they killed div jokes
margin auto worked fine for me... what can this do that margin can't?
Too easy. This should be illegal!
hallelujah
Still prefer flex items-center justify-center
And it only took... *checks calendar*... 27 years!
Works but I feel like we didn't need another way of doing it. As grid and flex Cover 99.9% of usecases im not aware of elements that have to be Block that have content i dont See the usecase for this.
Me who knows nothing about CSS: This is truly a game changer
dream come true lmao
dream come true lmao
The W3C are working backwards, why it was never defined before Flex/Grid!?
❤
it's strange you titled the video: "this should have been in CSS years ago".... considering the spec for align-content was released in 2012, and supposed by every browser by 2015 I guess the newness if it's supported in a block layout, but like.... before that is was just 1 additional property "display: flex/grid"....
Yep exactly. We should have been able to vertically center things with block elements years ago. I guess having so many alternatives really slowed progress on having it implemented for block elements.
My goto is position: absolute; inset: 0; margin: auto; width: fit-content; height: fit-content.
What happens when the container has two children? Would it behave the same as flex or grid? Or else?
From what I tried it looks to be the same as flex. The only difference I noticed was how margins collapse. Flex stacks margins on top one another, block merges the top and bottom margins together.
1:10 thats not correct place-items: center; means: justify-items: center; align-items: center; there is also place-content: center; which means justify-content: center; align-content: center; content is the area of the grid or flex layout where the child item lives in and item is the actual item in that area
@nomadshiba - good call out. That is my bad. I misspoke.
Someday we'll treat HTML and JS as a dress rehearsal, and take everything we now know and develop a vastly better replacement which will run alongside them in every browser, and after enough sites migrate, we drop the old languages. And throw a huge party.
Me: create a row with a column inside. Center that column. Put something in that column. Center the content of that column, voila volare vio
Why not content-align?
why not con-align-tent?
Like this's the real problem!?
@@mahmoudzakria6946 There was no problem to begin with. However, this naming changes the word order once again. Perhaps there is a reason, but from text-align perspective there is a PHP4 developer naming CSS attributes now. Cognitive load, etc. Naming is the simplest thing to do consistently, but here we are. Wrap this bastard into well named utility classes immediatelly.
Straight to the point, no bullshit. Subscribed.
This only works with pictures of cats.
We got "align-content: center;" before GTA6.
lol. Should be a metric on MDN and caniuse. Before GTA6: yes.
we got "align-content: center;" before GTAV.......
We almost got GTA6 before we got align: center! That’s the weirder part.
Impressive.
Perfect
Oh god… thankfully my brain has forgotten the arcane magic one had to do 10+ years ago to try to center something on a web-page…
this property came out out over 10 years ago.... so you could just use this
@@NotJayUU and how many browsers actually supported it, as opposed to just claiming that they did? To be fair, I wouldn’t know. This is more of a me problem, but at the time I needed to support websites that were being accessed in South America where you could only assume that they would have the version of the browser that came with whatever OS they were running. That’s what I was trying to communicate with the “+” but I get that is really not clear at all.
@@Vendavalez there's a website caniuse, it's good for checking this stuff. 2015 was when it was supported in all major browsers
Now you may begin to heal.
the beauty of css is that prob none of these will work for my purpose XD
So what's your purpose
Question: Is there a way today to make a set of divisions behave like a table, where it would dynamically adjust the size of each row and column?
That you can. Using the display property. You more or less mimic the structure of a table with divs. And apply the appropriate display property. e.g. <table> = display: table; <tr> = display: table-row; ... etc. I wouldn't recommend it though. It's a lot easier just to use a table. There is a lot of accessibility goodness when you use the semantically correct HTML tags. If it isn't actually a table, I would look into using display grid.
@@DevDiveIn That's very good to hear! Thank you. The problem with using Tables, at least 15 yrs ago when I was active, was how Web Crawlers interpret them. Tables are expected to contain tabular data, and not contextual content. Do you know if Accessibility tools like Screen Readers will be able to handle websites designed with tables today?
@Rovsau - Ya I don't miss those table days, or IE 6 for that matter ;) If the content belongs in a table, then screen readers prefer you use the html tag. When you use a divs by default screen readers lose reference to what other divs belong in the same row/col. You have to do some work to reimplement that functionality so screen readers can read it properly. If you're laying out an entire site. I wouldn't use tables or the div equivalent, there are much better alternatives now. Screen readers would try and read your site as a table which it is not. display: grid does pretty much the same thing as tables (and more), and is much more robust and flexible. I have a video on it if that helps. th-cam.com/video/B6QddhvpUUo/w-d-xo.html
Thanks man, straight to the point 🔥
so Safari might support this 2034
Failed so many interviews because of this lol
Why would text-align work on an image. Wierd, it literally says 'text'
Because image is by default an inline element. It is easier to imagine the image as just another big character in the text.
There is a new multikeyword display property. display: block flex or display: inline flex will let you specify both the placement and the inner layout. (Why these two distinct features were ever mashed together in one property is beyond me)
This is awesome! Thanks for sharing
Yeah, web design is “awesome”.
"HOW TO CENTER A DIV"
Lame a**
i still can't believe that this is a thing
Why I see this cat picture everywhere?
You could also use width 100% height 100% and object-fit also (assuming no other content in div)
This is why html needs a revamp
Yeah, but the problem with revamping html is older browser support. I never get why there's so much importance on supporting old browsers, especially now that Windows 7 has been discontinued and Windows 10 is going soon too. So the majority will be updated to many recent browsers. But it's a matter of making a website accessible to everyone. We have plenty of frameworks now too. And I know the React peeps won't get over their ex if and when html gets a major revamp. It also depends a lot on bigger corporations that decide on a standard for the web.
@@cake3014 people still use windows xp, trust me
@@Endrit719then just create a legacy mode that will replace the code with legacy compatible or something, most sites aren’t even compatible with old browsers
@@Endrit719 I know that that is the case but I don't get why 😮💨😮💨😮💨
@@cake3014 Not everyone cares about new technology and companies want to deliver websites to maximum amount of people, general population not being tech savvy enough isn't a good argument to abandon backwards compatibility. Yes you can revamp HTML which will work thousand times better than old HTML but try selling a fact that it will only work for 50% of users to any client and get ready to be laughed at.
I love to abuse flexboxes
I've already used this since 2019
ya... this came out in 2012, I don't get why every is acting like this is something crazy...
Because if I understood correctly it's not using grid or flex. It works directly on block elements
It was only released on March 19th 2024. It works on display: block. What you were using only worked with display: flex or grid. The support now is only about 79% align-content on display block, unlike the 96% align-content on display flex
@@NotJayUU why are y'all acting like some kind of OGs while knowing nothing about the topic
@@theseangle ?
place-items is actually shorthand for justify-items and align-items
justify-content ?
Finally.
Not cool to kill a meme Chrome!
YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSs