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. It provides some inputs for attributes of the iframe to an authorized user: Src-URL (textfield) Width of iframe (textfield), allowed: numbers (in px, without 'px') btw. For example, if the original video has an aspect ratio of 16:9, you’ll want to embed the video with dimensions that yield an aspect ratio of 16:9, such as 800 x 450. The percentage bottom padding is a percentage of the container width, so that gives it a fixed aspect ratio. The iframe module provides a custom content 'field' type. To avoid blank space in an embed, we recommend choosing a player size that matches your videos native aspect ratio. 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): It would be nice if we could just give it a 100% width, but it won't work as the height remains fixed. Here is what a typical YouTube embed code looks like, with fixed width and height: HTML iframe height Attribute HTML
0 Comments
Leave a Reply. |