Gérard Talbot wrote:
Xah Lee a écrit :
if i want to have a empty link, which way is more proper?
- - Your question is as logical, coherent as asking
- how to have a table without any table cells
- how to have a paragraph without any content
- how to have some kind of structure without any content or without any
functionality or without any purpose
Well, logically, it's not quite the same. The question apparently meant
"functional ly empty", i.e. a link that does not work as a link, as
opposite to an element with no content. A link that is empty in the
latter sense, <a href="something "></a>, is syntactically correct but
usually nonsensical - though it might be used to fool search engines,
and there is no law against browsers letting users to follow such a link.
A table without any table cells, on the other hand, is syntactically
incorrect (invalid), since a <table> element must contain at least one
<tr> element, which in turn must contain at least one <th> or <td>
element. The cell could be empty, though (<td></td>).
A paragraph without any content, <p></p>, is syntactically correct,
though the HTML spec explicitly says that it should not be used.
Actually, the common formatting trick is not <p></p> but <p> </p>,
which has content syntactically, but not semantically.
Followups trimmed to ciwah.