0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

iframeとは?

Posted at

iframeとは

  • HTML内に別のHTMLページを埋め込むタグ
  • 外部のコンテンツを自分のWebページに簡単に組み込むことができる
<iframe src="https://example.com" width="600" height="400"></iframe>

主な属性

  • src: 埋め込むコンテンツのURL
  • width, height: iframeの表示サイズ
  • allowfullscreen: 全画面表示を許可
  • loading: ブラウザーが iframe をどのように読み込むか設定
  • sandbox: セキュリティ強化のための制限を加える

特徴

  • 埋め込まれたページを独立したドキュメント(windowオブジェクト)として読み込む
  • ページの一部だけを更新できる
  • 異なるドメイン(オリジン)の場合、親ページからのDOM操作・データアクセスは制限される
  • 独立したナビゲーション・状態管理がされる
  • CSS・JavaScriptなどはiframe内と外で分離されている

注意

  • iframeで表示しているページの内容は、自分のサイトのコンテンツとしては評価されないためSEOの影響を考慮する必要がある
  • 複数のiframeを使うとメモリやCPUリソースを多く消費する
  • クリックジャッキングなどセキュリティ面のリスクを考慮する必要がある
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?