-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodalView2.html
More file actions
65 lines (58 loc) · 1.39 KB
/
Copy pathmodalView2.html
File metadata and controls
65 lines (58 loc) · 1.39 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* Styling for the modal */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
justify-content: center;
align-items: center;
display: -webkit-flex; /* For older WebKit browsers */
}
/* Styling for the modal content */
.modal-content {
max-width: 80%;
max-height: 80%;
}
/* Styling for the close button */
.close {
position: absolute;
top: 10px;
right: 10px;
color: #fff;
cursor: pointer;
}
</style>
</head>
<body>
<!-- Button to open the modal -->
<button onclick="openModal()">Open Modal</button>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<!-- Close button -->
<span class="close" onclick="closeModal()">×</span>
<!-- Image in the modal -->
<img src="your_image_url.jpg" alt="Modal Image">
</div>
</div>
<!-- JavaScript to control the modal -->
<script>
function openModal() {
document.getElementById("myModal").style.display = "flex";
}
function closeModal() {
document.getElementById("myModal").style.display = "none";
}
</script>
</body>
</html>