使用滚动条创建iframe区域

时间:2018-02-17 12:34:07

标签: html css html5

我想创建一个iframe区域,滚动条为like here

我检查了html代码,并创建了iframe,如下所示。但当我把东西放进去的时候,区域似乎是空的。它没有在屏幕上显示。

 <iframe width="100%" height="315" allowfullscreen>
  <a class="twitter-timeline"
       data-lang="en" 
       href="https://twitter.com/username" 
       data-tweet-limit="10">
  </a> <a href="#" class="btn btn-secondary btn-sm fright">Follow Us on Twitter</a> 
</iframe>

1 个答案:

答案 0 :(得分:0)

iframe的工作原理 没有任何消息来源。

 <iframe src="https://stackoverflow.com/questions/48841319/creating-iframe-area-with-scroll-bar" width="500" height="315" style="overflow-y:scroll;">
 </iframe>

使用div也一样。这是你想要的,除非它是你试图插入的另一个页面,然后使用iframe或object。

CSS

.divExample{
overflow-y:scroll;
width:500px;
height:315px;
float:left;
border:thin #000000 solid;
}

HTML

<div class="divExample">
<a class="twitter-timeline"
   data-lang="en" 
   href="https://twitter.com/username" 
   data-tweet-limit="10">
</a> <a href="#" class="btn btn-secondary btn-sm fright">Follow Us on Twitter</a> 
</div>