-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrange.html
More file actions
64 lines (58 loc) · 2.09 KB
/
range.html
File metadata and controls
64 lines (58 loc) · 2.09 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>µCSS — Range</title>
<link rel="stylesheet" href="../dist/mu.css">
</head>
<body>
<main class="container">
<hgroup>
<h1>Range</h1>
<p>Range slider using <code><input type="range"></code>.</p>
</hgroup>
<p><a href="index.html">← Back to examples</a></p>
<p><button class="btn btn-sm btn-secondary" onclick="document.documentElement.dataset.theme = document.documentElement.dataset.theme === 'dark' ? 'light' : 'dark'">Toggle dark mode</button></p>
<section>
<h2>Basic range</h2>
<label>Volume
<input type="range" min="0" max="100" value="50">
</label>
</section>
<section>
<h2>With output</h2>
<label>Brightness: <output id="brightness-val">75</output>%
<input type="range" min="0" max="100" value="75" oninput="document.getElementById('brightness-val').textContent = this.value">
</label>
</section>
<section>
<h2>With steps</h2>
<label>Rating (1-5): <output id="rating-val">3</output>
<input type="range" min="1" max="5" step="1" value="3" oninput="document.getElementById('rating-val').textContent = this.value">
</label>
</section>
<section>
<h2>Disabled</h2>
<label>Locked value
<input type="range" min="0" max="100" value="60" disabled>
</label>
</section>
<section>
<h2>In a form context</h2>
<article>
<header>Audio settings</header>
<label>Master volume: <output id="master-val">80</output>%
<input type="range" min="0" max="100" value="80" oninput="document.getElementById('master-val').textContent = this.value">
</label>
<label>Bass: <output id="bass-val">50</output>%
<input type="range" min="0" max="100" value="50" oninput="document.getElementById('bass-val').textContent = this.value">
</label>
<label>Treble: <output id="treble-val">65</output>%
<input type="range" min="0" max="100" value="65" oninput="document.getElementById('treble-val').textContent = this.value">
</label>
</article>
</section>
</main>
</body>
</html>