-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathh.html
More file actions
108 lines (94 loc) · 2.3 KB
/
h.html
File metadata and controls
108 lines (94 loc) · 2.3 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login/Register Flotante</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
}
/* Botones de abrir */
.btn {
padding: 10px 20px;
margin: 10px;
border: none;
background: blue;
color: white;
cursor: pointer;
}
/* Fondo oscuro */
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: none;
/* Oculto por defecto */
z-index: 9;
}
/* Modal */
.modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: white;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
width: 300px;
display: none;
z-index: 10;
/* Encima del fondo oscuro */
}
.close {
background: red;
color: white;
padding: 5px 10px;
border: none;
cursor: pointer;
margin-top: 10px;
}
/* Mostrar el modal cuando el ID es el objetivo */
#login:target,
#register:target {
display: block;
}
#login:target~.overlay,
#register:target~.overlay {
display: block;
}
</style>
</head>
<body>
<h1>Bienvenido</h1>
<a href="#login" class="btn">Iniciar sesión</a>
<a href="#register" class="btn">Registrarse</a>
<!-- Fondo Oscuro -->
<div class="overlay"></div>
<!-- Modal de Login -->
<div id="login" class="modal">
<h2>Login</h2>
<form>
<input type="text" placeholder="Usuario" required><br><br>
<input type="password" placeholder="Contraseña" required><br><br>
<button type="submit">Ingresar</button>
</form>
<a href="#" class="close">Cerrar</a>
</div>
<!-- Modal de Registro -->
<div id="register" class="modal">
<h2>Registro</h2>
<form>
<input type="text" placeholder="Usuario" required><br><br>
<input type="email" placeholder="Correo" required><br><br>
<input type="password" placeholder="Contraseña" required><br><br>
<button type="submit">Registrarse</button>
</form>
<a href="#" class="close">Cerrar</a>
</div>
</body>
</html>