Full-screen iframe with a height of 100%

前端 未结 17 1473
星月不相逢
星月不相逢 2020-11-22 04:35

Is iframe height=100% supported in all browsers?

I am using doctype as:



        
17条回答
  •  一整个雨季
    2020-11-22 05:07

    You could use frameset as the previous answer states but if you are insistent on using iFrames, the 2 following examples should work:

    
        
    
    

    An alternative:

    
        
    
    

    To hide scrolling with 2 alternatives as shown above:

    
        
    
    

    Hack with the second example:

    
        
    
    

    To hide the scroll-bars of the iFrame, the parent is made overflow: hidden to hide scrollbars and the iFrame is made to go upto 150% width and height which forces the scroll-bars outside the page and since the body doesn't have scroll-bars one may not expect the iframe to be exceeding the bounds of the page. This hides the scrollbars of the iFrame with full width!

提交回复
热议问题