-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml.html
More file actions
93 lines (84 loc) · 2.54 KB
/
html.html
File metadata and controls
93 lines (84 loc) · 2.54 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modern HTML Syntax Test</title>
<style>
:root {
--bg: #0f172a;
--panel: #111827;
--text: #e5e7eb;
--muted: #94a3b8;
--accent: #38bdf8;
--border: #1f2937;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: Inter, system-ui, sans-serif;
background: linear-gradient(180deg, #020617, #0f172a);
color: var(--text);
line-height: 1.6;
}
.container {
max-width: 760px;
margin: 0 auto;
padding: 48px 20px;
}
.card {
background: rgba(17, 24, 39, 0.9);
border: 1px solid var(--border);
border-radius: 16px;
padding: 24px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
h1 {
margin-top: 0;
font-size: 2rem;
}
p { color: var(--muted); }
button {
margin-top: 16px;
padding: 10px 16px;
border: 0;
border-radius: 10px;
background: var(--accent);
color: #082f49;
font: inherit;
font-weight: 600;
cursor: pointer;
}
button:hover { filter: brightness(1.08); }
.output {
margin-top: 16px;
padding: 12px 14px;
border-left: 3px solid var(--accent);
background: rgba(255, 255, 255, 0.03);
border-radius: 8px;
color: var(--text);
}
</style>
</head>
<body>
<main class="container">
<section class="card">
<h1>Modern HTML Syntax Test</h1>
<p>This example uses semantic HTML with embedded CSS and JavaScript only.</p>
<button id="greetButton" type="button">Click to Greet</button>
<div id="output" class="output">Waiting for interaction...</div>
</section>
</main>
<script>
const button = document.getElementById("greetButton");
const output = document.getElementById("output");
function greet(name) {
return `Hello, ${name}!`;
}
button.addEventListener("click", () => {
const now = new Date().toLocaleTimeString();
output.textContent = `${greet("World")} Current time: ${now}`;
});
</script>
</body>
</html>