quan846951943

css

<style type="text/css" media="screen">

.box{
  width: 80%;
  height: 500px;
  margin: 0 auto;
}
.left{
  width: 20%;
  height: 500px;
  float: left;
  border: 1px solid red;
}
#right{
  width: 79%;
  height: 500px;
  border: 1px solid red;
  float: left;
}
</style>

 

html

<div class="box">
  <div class="left">
    <a href="https://www.taobao.com/" title="" target="iframe_a">淘宝</a><br />
    <a href="https://www.jd.com/" title="" target="iframe_a">京东</a>
  </div>
  <div id="right">
    <iframe id="iframe" src="" name="iframe_a" frameborder="1" ></iframe>
  </div>
</div>

 

js

<script type="text/javascript">
  

<script type="text/javascript">
  var main = document.getElementById("right");
  var iframe = document.getElementById("iframe");
  var width = main.offsetWidth;
  var height = main.offsetHeight;
  iframe.style.width = width + "px";
  iframe.style.height = (height - 5) + "px";
</script>


</script>

分类:

技术点:

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2021-10-31
  • 2022-02-07
  • 2021-06-12
  • 2021-07-28
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-02-07
相关资源
相似解决方案