16
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

iframe内の要素にCSSを適用したった

Posted at

■前提
・jQueryを使う

■手順
①iframeが読み込まれた時にCSSが適用されるようにする(loadイベント)
②iframe内のCSSを適用したい要素を取得する
③取得した要素にCSSを適用する

■コード

$("iframe").on("load",function(){
 $("iframe").contents().find('header').css("display","none");
 $("iframe").contents().find('.selector').css({"margin":"15px","padding":"15px"});
});

(参考)
http://www.koikikukan.com/archives/2015/03/03-005555.php

16
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?