<mark> Tag Syntax
<body> ... ... phrasing content expected ...<mark>... phrasing content ...</mark>... ... </body>
Rules for coding HTML mark
elements
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 mark element where phrasing content is expected.
- Begin the mark element with a starting <mark> 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 <mark> tag as appropriate.
- Inside the mark element, between the starting
<mark>
tag and the ending</mark>
tag, code the inner HTML phrasing content. - End the mark element with a matching
</mark>
closing tag.
Content Model
Content of the mark element
The content of the mark element can include HTML comments, text content and only those HTML tags that can be used in phrasing content.
Dynamically inserting a <mark> tag
- If a starting <mark> tag and ending </mark> tag are inserted in the inner HTML of two different HTML elements, end those elements with the appropriate ending tags before the <mark> tag(s) and start them again after the <mark> tag(s). See the <mark> tag example below.