

Seems Sass has this funny thing where you need to add an extra comma to the end of a nested array with a single item. You could also set max-height, max-width, and/or min-height, min-width if you don't want it to grow ridiculously big or small, since it's based on the browser's width now and not the container and will grow/shrink indefinitely. include responsive-type ('') include responsive-type ('1.051900px', line-height) But Sass is giving me an error when I compile: index out of bounds for nth (list, n). * width within the parent (could use vw instead of course) */ Now, bumming off of Isaac's idea, it's easier in modern browsers to simply use vw units to force aspect ratio (although I wouldn't also use vh as he does or the aspect ratio will change based on window height). new ResizeObserver ( () > console.log ('resizing')). 100% means theĭiv will remain 100% as tall as it is wide, or That would scale font-size from a minimum of 16px (at a 320px viewport) to a maximum of 22px (at a 1000px viewport). But in order to get the iframe to show up inside the zero-height container, you need to make the container relative and the iframe absolute, positioned inside the div.Bumming off Chris's idea, another option is to use pseudo elements so you don't need to use an absolutely positioned internal element. Getting right to the code, here’s a working implementation: It’s worth looking at our more recent post Simplified Fluid Typography for practical, clamped, viewport-based type sizing.
HTML < div class ' resizable ' > < p class ' resizable ' > This paragraph is resizable in all directions, because the CSS resize property is set to both on this element. The percentage bottom padding is a percentage of the container width, so that gives it a fixed aspect ratio. In the example below, a resizableHow this works: The container element is given a zero height and a percentage bottom padding. container for a responsive fixed width container. Responsive Grids Layout Div with CSS and HTML The responsive grid design adjusts to screen size and direction, guaranteeing consistency crosswise over formats. This property specifies the maximum width that an. Note that, due to padding and more, neither container is nestable.

That is what is blocking your element from filling up whenever your content would regularly go above 500px. You can use the max-width property in your stylesheet to create a responsive CSS website with a fixed width.
As G-Cyr said in his comment, your container element (showcase) has an absolute height of 500px.W3Schools Demo
Resize this responsive page
London
London is the capital city of England.
It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.What you need to do is wrap it in a container like so (note the class names and removal of the width and height): Showcase has a fixed height, turn it into a min-height or remove it to allow the container to fit its content's. On screens smaller than 601 pixels it resizes to 100.

The w3-half Class The width of the w3-half class is 1/2 of the parent element (style'width:50'). It would be nice if we could just give it a 100% width, but it won't work as the height remains fixed. The responsive classes above must be placed inside a w3-row class (or w3-row-padding class) to be fully responsive. Here is what a typical YouTube embed code looks like, with fixed width and height: You can also use this technique with most other iframe-based embeds, such as slideshows.
The key to creating a responsive YouTube embed is with padding and a container element, which allows you to give it a fixed aspect ratio. Here is what a typical YouTube embed code looks like, with fixed width and height: It would be nice if we could just give it a 100 width, but it won't work as the height remains fixed.