Why I Cannot Use iframe Absolute Positioning to Set Height & Width



iFrames are replaced elements and considered different than non-replaced elements. The<div> element is a non-replaced element.

To achieve the same result i.e. to set both the left/right or top/bottom in an iframe, use a div as a wrapper with absolute position, top, left, right, bottom.

Place your iframe with −

width:100%
height:100%.
Updated on: 2020-06-25T07:17:36+05:30

444 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements