How does the DiggBar dynamically resize its iframe's height based on content not on their domain?

前端 未结 5 2152
南方客
南方客 2020-12-13 01:08

Someone has already asked, How does the DiggBar work? in a previous question.

While someone provided a decent answer it didn\'t address one thing:

5条回答
  •  没有蜡笔的小新
    2020-12-13 01:59

    100% in an iframe is a 100% percent of the declared parent space. An example is:

    /* parent element */
    
    html, body {
       width: 100%;
       height: 100%;
    }
    
    /* child element */
    iframe {
      width: 100%; /* this is truly 100%, try it out */
      height: 100%; /* try it out */
    

提交回复
热议问题