Tools, FAQ, Tutorials:
HTML Element Content Models
What Are the HTML Element Content Models?
✍: FYIcenter.com
There are 4 content models defined for HTML elements:
1. EMPTY - No content. Nothing between the opening tag and the closing tag. For example:
<br/> - "br" element has no content. <br></br> - Same as above. <meta name="Author" content="FYICenter.com"/>
2. PCDATA - Parsed Character DATA. A string of characters and character entities. Empty content is allowed in this model. But no other HTML elements are allowed in the content.
<!-- PCDATA: Pure character string -->
<title>My First HTML Document</title>
<!-- PCDATA: Empty string -->
<textarea rows="4" cols="40"></textarea>
<!-- PCDATA: Characters mixed with entities -->
<textarea rows="4" cols="40">
while ($i=0; $i<3; %i++) print "Knock ";
</textarea>
3. Sub-elements only - A sequence of sub-elements. No character strings are allowed in the content.
<!-- Sub-elements only: "head" can only take sub-elements like "title" and "meta" --> <head> <title>My First HTML Document</title> <meta name="Author" content="FYICenter.com"/> </head> <!-- Sub-elements only: "tr" can only take sub-elements like "td" --> <tr> <td>Author:</td> <td>FYIcenter.com</td> </tr> <!-- Sub-elements only: "ul" can only take sub-elements like "li" --> <ul> <li>My First XHTML Document</li> </ul>
4. Mixed - A mixture of PCDATA and sub-elements. Empty content is also allowed in this model.
<!-- Mixed content: "p" is having text strings mixed an "em" element --> <p>The nature of <em>yin and yang</em> is relative.</p> <!-- Mixed content: "td" is having text strings mixed with a "p" element --> <td>Dear Visitor, <p>Welcome to FYIcenter.com!</p> Thank you. </td>
⇒ HTML Elements with EMPTY Contents
2017-07-30, ∼2254🔥, 0💬
Popular Posts:
Can Two Forms Be Nested? Can two forms be nested? The answer is no and yes: No. You can not nest two...
How to add request query string Parameters to my Azure API operation 2017 version to make it more us...
How to extend json.JSONEncoder class? I want to encode other Python data types to JSON. If you encod...
What is EPUB 3.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 3.0 Metadata "dc:publisher" ...
How To Set session.gc_divisor Properly in PHP? As you know that session.gc_divisor is the frequency ...