Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
17
Help us understand the problem. What is going on with this article?
@tsunet111

HTMLページ内フル画面のiframe

More than 1 year has passed since last update.

概要

余白なし、枠なしの縦も横も100%目いっぱいのiframeをつくりたい

デモ

フル画面
https://codepen.io/tsunet111/full/WNvzKWz
CodePen
https://codepen.io/tsunet111/pen/WNvzKWz

コード

<div class="container">
<iframe src="iframecontent.html" width="100%" height="100%"></iframe>
</div>

* {
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

iframe {
  border:none;
  width:100%;
  height:100%;
}
$(window).on('load resize',function(){
    $('.container').css('width',  $(window).width());
    $('.container').css('height',  $(window).height());
});

jQueryを使用しています。

17
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
tsunet111
エレファンキューブというデジタル教材に特化した制作会社の代表。長らくFlash/ActionScripがメインでしたが、最近は、JavaScript、PHP、MYSQLなど必要に応じて使う。Facebookで「PhoneGap/Cordova 日本語グループ」運営中→ https://www.facebook.com/groups/phonegap.cordova.jp/

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
17
Help us understand the problem. What is going on with this article?