-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
44 lines (42 loc) · 1.12 KB
/
test.html
File metadata and controls
44 lines (42 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Embed Web Page</title>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f4f4f4;
}
iframe {
border: none;
width: 80%;
height: 80%;
}
</style>
</head>
<body>
<div class="container">
<iframe src="" id="webFrame" title="Embedded Web Page"></iframe>
</div>
<script>
// JavaScript to dynamically set the iframe src based on user input
const iframe = document.getElementById('webFrame');
const url = prompt("Enter the URL of the page to embed:");
if (url) {
iframe.src = url;
} else {
iframe.src = "about:blank"; // fallback if no URL is provided
}
</script>
</body>
</html>