Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

right and bottom ignored when position fixed iframe

I have the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head></head>
   <body>
      <iframe src="http://jl.evermight.net" style="overflow:scroll; display:block; position:fixed; top:10px; bottom:10px; right:10px; left:10px;"></iframe>
   </body>
</html>

how come my iframe doesn't fill the entire browser window leaving only a 10 px space between top, right, bottom and left of the browser window? If I replaced the iframe tag with a p tag, while keeping the style rule, then it works with the p tag.

It seems the iframe is ignoring my right and bottom css rule. How do I make the iframe acknowledge the right and bottom rule?

like image 374
John Avatar asked Oct 17 '25 07:10

John


1 Answers

As Alan Shortis suggested:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head></head>
    <body>
        <div style="position:fixed; top:10px; bottom:10px; right:10px; left:10px;">    
            <iframe src="http://jl.evermight.net" style="overflow:scroll;width:100%;height:100%;"></iframe>
        </div>
    </body>
</html>
like image 54
leoap Avatar answered Oct 19 '25 23:10

leoap



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!