CSS Tip: Extend a Child Beyond Parent Width (the better way)

CSS Tip: Extend a Child Beyond Parent Width (the better way)

Dmitry Mayorov

54 года назад

1,307 Просмотров

Get updates about new videos → https://tinyurl.com/yuu8x8my
Follow me on Twitter: https://x.com/dmtrmrv
Follow me on Bluesky: https://bsky.app/profile/dmtrmrv.bsky.social

GitHub Repo: https://github.com/dmtrmrv/demo-content-width
Live Demo: https://dmtrmrv.github.io/demo-content-width/

In this video, we’ll tackle a common CSS challenge: extending elements outside their container without breaking the layout. I’ll show you a simple, reusable approach that avoids messy calculations and leverages the powerful min() function to handle responsive widths.

We’ll walk through the code step-by-step, using CSS custom properties and utility classes to manage content width and site gutters cleanly. By the end, you’ll have a solid pattern for full-width components that works on any project.

Chapters
00:00 – Intro
00:16 – Demo Walkthrough
01:05 – The Issue with Setting Width on the Container
01:49 – A Better Approach
05:31 – What About Full-Width Images?
06:30 – Adding Gutters
07:10 – The Problem
07:31 – The Solution
08:18 – Using min() for Responsiveness
10:23 – Fixing Utility Classes

#CSS, #WebDevelopment, #FrontendDevelopment, #ResponsiveDesign, #CSSTips, #CSSLayouts, #FullWidthDesign, #WebDesign, #CSSHacks, #HTMLandCSS, #CSSTricks, #WebDevelopmentTips, #CodingTutorial, #CSSTutorial, #FrontendTips, #WebDev, #CSSForBeginners, #LearnCSS, #WebDesignTips, #WebDevTips
Ссылки и html тэги не поддерживаются


Комментарии: