Answers for "iframe width responsive"

2

full width and height iframe

<body style="margin:0px;padding:0px;overflow:hidden">
    <iframe src="http://www.youraddress.com" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:100%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px" height="100%" width="100%"></iframe>
</body>
Posted by: Guest on June-13-2020
2

iframe responsive

<div class="row">	
  <div class="col-md-12 d-flex justify-content-center"> 
    <div class="video-iframe">
      <iframe class="video-responsive-iframe" src="<?= $blog_item['Blog']['video_url'] ?>" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    </div>
  </div>
</div>

<style>
  
  .video-iframe {
	position: relative;
	width: 100%;
	overflow: hidden;
	padding-top: 56.25%; /* 16:9 Aspect Ratio */
  }

  .video-responsive-iframe {
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      width: 100%;
      height: 100%;
      border: none;
  }

  .d-flex {
  	display: flex;
  }
  
  .justify-content-center {
    justify-content: center;
  }
</style>
Posted by: Guest on April-21-2021
-1

full width and height iframe

<body style="margin:0px;padding:0px;overflow:hidden">
    <iframe src="http://www.youraddress.com" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe>
</body>
Posted by: Guest on June-13-2020

Browse Popular Code Answers by Language