Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index

XHTML Tutorials - Introduction To Element Content Syntax

By: FYICenter.com

Part:   1  2   3  4 

(Continued from previous part...)

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>

What Are the XHTML Elements Defined with EMPTY Contents?

The following XHTML elements are defined to use the EMPTY content model:

  • <meta ... /> - Element to provide meta data to the document.
  • <link ... /> - Element to provide a link to a CSS file.
  • <br/> - Element to break a line.
  • <hr/> - Element to insert a horizontal line.
  • <img/> - Element to insert an image.
  • <input/> - Element to provide input control in a form.

Remember that EMPTY content elements can not have any content and must be closed immediately.

What Are the XHTML Elements Defined with PCDATA Contents?

The following XHTML elements are defined to use the PCDATA content model:

  • <title> - Element to provide a title to the document.
  • <style> - Element to provide a CSS to the document.
  • <script> - Element to provide a client side scripts.
  • <option> - Element to provide an option of a selection control.
  • <textarea> - Element to provide a text area control in a form.

Remember that PCDATA content elements can not have any other XHTML elements in their contents.

What Are the XHTML Elements Defined with Sub-elements Contents?

The following XHTML elements are defined to use the sub-element content model:

  • <html> - The root element of the document.
  • <head> - Element to provide head information to the document.
  • <ul> - Element to provide an un-numbered list.
  • <ol> - Element to provide an ordered list.
  • <form> - Element to provide an input form.
  • <select> - Element to provide a selection control in a form.
  • <table> - Element to provide a table structure in the document.
  • <tr> - Element to provide a row to a table.

Remember that sub-element content elements can only have other XHTML elements in their contents. You can not include any test strings directly in their contents.

What Are the XHTML Elements Defined with Mixed Contents?

The following XHTML elements are defined to use the mixed content model:

  • <p> - Element to insert a paragraph.
  • <pre> - Element to insert a pre-formatted text.
  • <li> - Element to insert an item into a list.
  • <td> - Element to insert a cell into a table.
  • <h1> - Element to insert a first level heading.
  • <a> - Element to insert an anchor.
  • <div> - Element to insert a block container.
  • <span> - Element to insert an inline container.

Remember that mixed content elements can have text strings and sub-elements in their contents.

(Continued on next part...)

Part:   1  2   3  4 


Selected Developer Jobs:

More...