

This will force the embed elements to expand fullwidth automatically. Then specify the child elements (iframe, object embed) 100 width, 100 height, with absolute position. The percentage bottom padding is a percentage of the container width, so that gives it a fixed aspect ratio. You will need to wrap the responsive youtube embed code with a div and specify a 50 to 60 padding bottom. How this works: The container element is given a zero height and a percentage bottom padding. What you need to do is wrap it in a container like so (note the class names and removal of the width and height): That is what is blocking your element from filling up whenever your content would regularly go above 500px.

To make page responsive to all device we need to use some basic fundamental such as:- 1. As G-Cyr said in his comment, your container element (showcase) has an absolute height of 500px. This is called Responsive Web Development (RWD). It would be nice if we could just give it a 100% width, but it won't work as the height remains fixed. Showcase has a fixed height, turn it into a min-height or remove it to allow the container to fit its content's. Here is what a typical YouTube embed code looks like, with fixed width and height:
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. You can also use this technique with most other iframe-based embeds, such as slideshows. In the example below, a resizableelement).
The image is going to be responsive (it will scale up and down).
This method however will result in your background image being horizontally stretched whenever the window's width exceeds the aspect preserved width of the image you are using.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. Set the width property to a percentage value and the height to 'auto'.A better solution, in many cases, will be to use the max-width property instead. The second argument for the background-size element will make sure the image never scales vertically at all. The responsive classes above must be placed inside a w3-row class (or w3-row-padding class) to be fully responsive. If the width property is set to a percentage and the height property is set to 'auto', the image will be responsive and scale up and down: Notice that in the example above, the image can be scaled up to be larger than its original size. Since the above example maintains the aspect ratio, the image will scale vertically to the point where it exceeds the size of the container it is in and will appear to be cut off on the bottom.

Doing it this way will maintain the aspect ratio of your background image and should allow it to scale with the window. You can use that css code for div tags and the page body, although in my experimentation the width and height values are not necessary for the page body. I don't know if this is the answer you want but I usually make background images scale to the window size with code like this: width: 100% īackground-image: url('./images/contact-bg.png') I wanted to just leave a comment but I don't seem to have the option.
