search

Home  >  Q&A  >  body text

javascript - iframe Why do the scroll bars appear like this when loading a web page?

Excuse me, what are you asking about?iframeWhen loading a large page, a small scroll bar appears first. The page only displays so much, and then it takes a while to display all of them. Is there any way to directly display all of them? , this is so ugly. . .

仅有的幸福仅有的幸福2841 days ago571

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:28:44

    followed by iframe的大小有关,如果确定iframe的大小而非自适应内容的话,建议设定好iframewidth,height or:

    html, body, iframe {
        width: 100%;
        height: 100%;
    }
    

    Sample code:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            html,body,iframe{
                width: 100%;
                height: 100%;
                margin: 0;
                padding: 0;
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <iframe src="http://www.qq.com/" frameborder="0"></iframe>
    </body>
    </html>    

    reply
    0
  • Cancelreply