<var> Tag Syntax
<body> ... ... phrasing content expected ...<var>... phrasing content ...</var>... ... </body>
Rules for coding the HTML var
element
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
- Code the var element to indicate a variable that is to be replaced where phrasing content is expected.
- Begin the var element with a starting <var> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Include any HTML global attributes on the <var> tag as appropriate.
- Inside the var element, between the starting
<var>
tag and the ending</var>
tag, code the inner HTML phrasing content. - End the var element with a matching
</var>
closing tag.
Content Model
Content of the var element
The content of the var element can include HTML comments, text content and only those HTML tags that can be used in phrasing content.