Рет қаралды 5,121
In this video, we'll explore together how to use CSS Subgrid for a popular layout: a newsletter sign-up form where everything aligns side by side, and the submit button lines up perfectly with the input fields. This setup can get a bit tricky, especially with the addition of labels and changing help text for the input fields.
Previously, achieving such layouts often required JavaScript. But now, thanks to the wider support for "subgrid," it's become much simpler to accomplish without any JavaScript. Join me in this video to discover how to leverage this fantastic CSS Grid feature for your projects.
CodePen: codepen.io/dmtrmrv/pen/ZEPNxjV
Chapters
00:00 - Intro
00:32 - Keeping Form Control and Newsletter Form Separate
01:20 - Building the Layout
03:04 - Using 'auto' for Grid Widths Where Appropriate
03:53 - Encountering Issues
04:10 - Enter Subgrid
06:06 - Making Final Adjustments
07:26 - Keeping Form Control intact
08:07 - Et Voilà!
08:10 - Demonstrating Robustness
09:00 - Conclusion