Skip to main content
  1. Posts/

Cara Membuat iFrame HTML

1 min
html php html
Table of Contents

iFrame adalah teknik html yang memungkinkan Anda untuk melakukan embed data website seperti text, gambar hingga video dalam sebuah halaman website.

Elemen iFrame berfungsi untuk mengambil konten dari sebuah sumber dan menampilkan datanya sesuai dengan url sumber yang digunakan. iFrame tidak hanya digunakan untuk membuat satu halaman layout website, namun juga bisa digunakan untuk mengisi bagian tertentu pada website

Script iFrame
#

Contoh script iframe.

<html lang="en-US">
<head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <meta name="description" content="iframe adalah">
        <meta name="keywords" content="iframe">
        <meta name="author" content="iframe">
        <meta name="theme-color" content="#3498db" />
        <link rel="shortcut icon" type="image/png" href="http://web1.example.com/favicon.ico" />
        <title>iframe</title>
</head>
<body>
<iframe src="http://web1.example.net" style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
    "Your browser does not support iframes"
</iframe>
</body>
</html>

Sesuaikan <iframe src dan beberapa bagian meta lainnya.

Jika Anda menggunakan script dengan format PHP.

<?php

echo 
'<html lang="en-US">
script iframe
</html>';

Note
#

Pastikan untuk source website tidak terdapat header x-frame-options: SAMEORIGIN karena membuat tampilan web muncul error.

Related

Setup Apache dan PHP-FPM di Docker
7 mins
apache docker apache php
Phalcon Error: Dispatcher has detected a cyclic routing causing stability problems
1 min
phalcon phalcon php
Install Redis di Linux
1 min
linux php linux
Install Memcached di Linux
1 min
linux php linux
Install APCu di Linux
1 min
linux php linux
Serve HTML using Express.js
1 min
nodejs html nodejs