-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathaudio.html
More file actions
117 lines (97 loc) · 4.17 KB
/
audio.html
File metadata and controls
117 lines (97 loc) · 4.17 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
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tag <audio></title>
<link rel="stylesheet" href="utils/css/global.css">
<link rel="stylesheet" href="utils/css/embed.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
</head>
<body>
<header>
<nav>
<div class="logo">Tags HTML5</div>
<ul class="nav-links">
<li><a href="index.html">Home</a></li>
<li><a href="referencias.html">Referências</a></li>
<li><a href="sobre.html">Sobre Nós</a></li>
</ul>
</nav>
</header>
<main>
<article class="main-content">
<section class="title-section-tag">
<h1>Tag HTML5 <audio></h1>
</section>
<section class="content">
<section class="example-section">
<h3>Definição e uso</h3>
<p class="description">
A tag <audio> permite incorporar arquivos de áudio em uma página HTML5.
É possível adicionar controles, autoplay, loop e suportar múltiplos formatos (MP3, OGG, WAV).
<br>
<mark>Se o navegador não suportar a tag, é possível incluir uma mensagem alternativa.</mark>
</p>
</section>
<section class="example-section">
<h3>Estrutura Básica</h3>
<p class="description">
A sintaxe típica do elemento é: <br>
<code><audio controls><source src="arquivo.mp3" type="audio/mpeg"></audio></code>
</p>
</section>
<section class="example-section">
<h3>Exemplo 1: Player simples</h3>
<div class="code-block">
<audio controls><br>
<source src="musica.mp3" type="audio/mpeg"><br>
<source src="musica.ogg" type="audio/ogg"><br>
Seu navegador não suporta o elemento de áudio.<br>
</audio>
</div>
<h3>Exemplo 2: Autoplay e loop</h3>
<div class="code-block">
<audio controls autoplay loop><br>
<source src="tema.wav" type="audio/wav"><br>
Seu navegador não suporta o elemento de áudio.<br>
</audio>
</div>
</section>
</section>
</article>
<aside class="sidebar">
<h2>Outras Tags HTML5</h2>
<input type="text" id="searchInput" placeholder="Pesquisar tag..." class="btn search-box">
<ul class="sidebar-links" id="tagList">
<li><a href="body.html"><body></a></li>
<li><a href="audio.html"><audio></a></li>
<li><a href="video.html"><video></a></li>
<li><a href="img.html"><img></a></li>
<li><a href="a.html"><a></a></li>
<li><a href="section.html"><section></a></li>
</ul>
</aside>
</main>
<footer>
<p>Copyright © 2025 Tutorial HTML5</p>
<p><a href="index.html">Home</a> | <a href="sobre.html">Sobre Nós</a> | <a
href="referencias.html">Referências</a></p>
</footer>
<script>
const searchInput = document.getElementById('searchInput');
const tagList = document.getElementById('tagList');
const items = tagList.getElementsByTagName('li');
searchInput.addEventListener('keyup', function () {
const filter = this.value.toLowerCase();
for (let i = 0; i < items.length; i++) {
const link = items[i].getElementsByTagName('a')[0];
const text = link.textContent.toLowerCase();
items[i].style.display = text.includes(filter) ? '' : 'none';
}
});
</script>
</body>
</html>