forked from juliavelosodias/Web-References-HTML5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoctype.html
More file actions
143 lines (128 loc) · 6.21 KB
/
doctype.html
File metadata and controls
143 lines (128 loc) · 6.21 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tag <!DOCTYPE></title>
<link rel="stylesheet" href="utils/css/global.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 HTML</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 HTML <!DOCTYPE></h1>
</section>
<section class="content">
<section class="example-section">
<h3>Exemplo</h3>
<p>Define o tipo de documento e a versão do HTML utilizada.</p>
<div class="code-block">
<!DOCTYPE html><br>
<html><br>
<head><br>
<title>Exemplo</title><br>
</head><br>
<body><br>
<p>Olá, mundo!</p><br>
</body><br>
</html>
</div>
</section>
<section class="example-section">
<h3>Definição e uso</h3>
<p class="description">
A declaração <strong><!DOCTYPE></strong> não é uma tag HTML propriamente dita, mas uma instrução
para o navegador sobre qual versão do HTML o documento está usando.
</p>
<p>Ela deve aparecer no topo do documento, antes da tag <strong><html></strong>.
No HTML5, a declaração é simples e padronizada: <strong><!DOCTYPE html></strong>.
</p>
</section>
<section class="example-section">
<h3>Versões anteriores do DOCTYPE</h3>
<p>A declaração DOCTYPE variava conforme a versão do HTML. Veja alguns exemplos históricos:</p>
<table class="attributes-table">
<thead>
<tr>
<th>Versão</th>
<th>Declaração</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>HTML 5</strong></td>
<td><!DOCTYPE html></td>
</tr>
<tr>
<td><strong>HTML 4.01 Strict</strong></td>
<td><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"></td>
</tr>
<tr>
<td><strong>HTML 4.01 Transitional</strong></td>
<td><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"></td>
</tr>
<tr>
<td><strong>XHTML 1.0 Strict</strong></td>
<td><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"></td>
</tr>
</tbody>
</table>
</section>
<section class="example-section">
<h3>Importância</h3>
<p>Sem o <strong><!DOCTYPE></strong>, os navegadores podem entrar em <em>quirks mode</em>, renderizando a página
com comportamento inconsistente.
Por isso, ele garante que o navegador siga o modo de compatibilidade padrão.
</p>
</section>
</section>
</article>
<aside class="sidebar">
<h2>Outras Tags HTML</h2>
<input type="text" id="searchInput" placeholder="Pesquisar tag..." class="btn search-box">
<ul class="sidebar-links" id="tagList">
<li><a href="a.html"><a></a></li>
<li><a href="cite.html"><cite></a></li>
<li><a href="figure.html"><figure></a></li>
<li><a href="link.html"><link></a></li>
<li><a href="progress.html"><progress></a></li>
<li><a href="sup.html"><sup></a></li>
<li><a href="wbr.html"><wbr></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>
</body>
</html>
<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>