Fix "width: 100%" Overflow Easily

VideoZoran Jambor

A brief guide for the upcoming 'stretch' value in CSS.

A brief guide for the upcoming stretch value in CSS, which forces the element to take 100% width/height of the parent container while taking padding & margin into consideration, thus preventing unwanted overflow easily without using calc() or box-sizing.

Guide to corner-shape CSS Property

Chapters

  • 00:00 The problem with "width:100%" and overflow
  • 00:36 How to fix border overflow using "box-sizing: border-box"
  • 00:54 How to use the "calc()" function to fix overflow due to margin
  • 01:29 How to use the "stretch" value to fix overflow due to margin
  • 01:52 Browser support for "stretch" value
  • 02:42 Should you use "stretch" value today?

Demo

Links

CSS Stickers

CSS Stickers

A set of beautiful, cute, and funny CSS stickers to showcase your love for CSS.

Get Your Set Today »
CSS Weekly YouTube Channel

CSS Weekly YouTube Channel

Weekly hands-on tutorials, tips, tools, news, and more — everything related to CSS and front-end development, created by Zoran Jambor.

Subscribe Today »