Content deleted Content added
m Fixed list in →HTML 4 |
m →Elements: Using "<br />" confuses readers into believing " /" is needed for this element. It's been discouraged by both the W3C and the WHATWG to use br in such a way. The WHATWG spec only references <br>, not <br />. |
||
Line 155:
The start tag may also include the element's ''attributes'' within the tag. These indicate other information, such as identifiers for sections within the document, identifiers used to bind style information to the presentation of the document, and for some tags such as the {{code|lang=html|code=<img>}} used to embed images, the reference to the image resource in the format like this: {{code|lang=html|code=<img src="example.com/example.jpg">}}
Some elements, such as the [[line breaking character|line break]] {{code|lang=html|code=<br
Many tags, particularly the closing end tag for the very commonly used paragraph element {{code|lang=html|code=<p>}}, are optional. An HTML browser or other agent can infer the closure for the end of an element from the context and the structural rules defined by the HTML standard. These rules are complex and not widely understood by most HTML authors.
The general form of an HTML element is therefore: {{code|lang=html|code=<tag attribute1="value1" attribute2="value2">''content''</tag>}}. Some HTML elements are defined as ''empty elements'' and take the form {{code|lang=html|code=<tag attribute1="value1" attribute2="value2">}}. Empty elements may enclose no content, for instance, the {{code|lang=html|code=<br
The name of an HTML element is the name used in the tags.
The end tag's name is preceded by a slash character, <code>/</code>, and that in empty elements the end tag is neither required nor allowed.
Line 200:
===== Line breaks =====
{{code|lang=html|code=<br
<syntaxhighlight lang="html"><p>This <br> is a paragraph <br> with <br> line breaks</p></syntaxhighlight>
|