Lista de discussão de MAC 2301
[Prévia por Data][Próxima por Data]
[Prévia por Assunto][Próxima por Assunto]
[Índice por Data][Índice por Assunto]
[Envie uma nova mensagem para a lista]
[Responda esta mensagem]
EP - Especificacoes do HTML
- Subject: EP - Especificacoes do HTML
- From: phx@ozdobe.org (Thomas Ufer)
- Date: Thu, 21 Mar 2002 22:05:38 GMT
Ae pessoal,
pra resolver de vez nossas duvidas de "qual tag tem que ser fechada", "como e' o
comentario em HTML" etc, fui dar uma olhada no W3C (www.w3c.org), que e' quem
padroniza o HTML.
Pra quem ta meio perdido vale a pena dar uma olhada la. Inclusive quem nao manja
de HTML tem um tutorial (http://www.w3.org/MarkUp/Guide/) legal.
Bom, mas a parte que nos interessa ta na pagina "HTML 4.01 Specification"
(http://www.w3.org/TR/REC-html40/). Abaixo seguem umas citacoes dessa pagina.
So' pra entender melhor:
um "comando" de html e' o que eles chamam de "element", e que pode ou nao ter as
tags de abertura e fechamento, e tem um "content" entre essas duas tags.
Por exemplo: o "element" FONT tem a "start tag" <FONT> e a "end tag" </FONT> e o
"content" e' o texto entre elas.
-= SOBRE ELEMENTOS SEM "END TAG" =-
------------------------------------------------
"Some HTML element types allow authors to omit end tags (e.g., the P and LI
element types). A few element types also allow the start tags to be omitted; for
example, HEAD and BODY. The HTML DTD indicates for each element type whether the
start tag and end tag are required.
Some HTML element types have no content. For example, the line break element BR
has no content; its only role is to terminate a line of text. Such empty
elements never have end tags. The document type definition and the text of the
specification indicate whether an element type is empty (has no content) or, if
it can have content, what is considered legal content.
Element names are always case-insensitive."
------------------------------------------------
Ou seja pra saber quais elementos tem que ser fechados ou lemos todo o texto das
especificacoes ou consultamos a Document type definition (DTD) que pode ser
achada em: http://www.w3.org/TR/REC-html40/sgml/dtd.html
O DTD e' jeito de definir "Markup Languages" segundo a norma SGML (Standard
Generalized Markup Language) [ISO8879] na qual o HTML e' baseado.
Se voces forem olhar o DTD vao ver que e' uma coisa horrivel e muito pentalha de
ser lida. A vantagem e' que todos os elemento do HTML ta definidos nesse
arquivo. Pra achar os elemento que nao tem tag de fechamento tem que procurar as
linhas do tipo:
<!ELEMENT "nome do elemento" - O EMPTY -- "Comentario" -->
Por exemplo:
<!ELEMENT IMG - O EMPTY -- Embedded image -->
O "EMPTY" significa que aquele elemento na tem conteudo, ou seja nao precisa de
tag de fechamento.
Depois vou ver se fasso um programinha que filtra esse arquivo e so' pega os
elementos que queremos.
-= SOBRE O ANINHAMENTO =-
------------------------------------------------
"Please consult the SGML standard for information about rules governing elements
(e.g., they must be properly nested, an end tag closes, back to the matching
start tag, all unclosed intervening start tags with omitted end tags (section
7.5.1), etc.)."
------------------------------------------------
Tentei pegar a normal do SGML mas a ISO cobra (!!!!) pra liberar as normas.
Ou seja tudo que achei e' o que esta acima. Como ele diz "properly nested"
deduzo que nao sejam permitidas tags cruzadas (<B><I></B></I>).
Ainda e' bom resaltar que uma tag de fechamento (</tag>) por definicao fecha
todas as tags entre ela mesma e sua tag de abertura (<tag>).
-= SOBRE OS COMENTARIOS =-
------------------------------------------------
"HTML comments have the following syntax:
<!-- this is a comment -->
<!-- and so is this one,
which occupies more than one line -->
White space is not permitted between the markup declaration open delimiter("<!")
and the comment open delimiter ("--"), but is permitted between the comment
close delimiter ("--") and the markup declaration close delimiter (">"). A
common error is to include a string of hyphens ("---") within a comment. Authors
should avoid putting two or more adjacent hyphens inside comments."
------------------------------------------------
Sem comentarios... :-)
Bom, por enquanto e' isso. Desculpem o e-mail monstro, mas eu acho que deve ser
util. Se nao podem xingar!
[]'s
Thomas