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

XHTML 1.0 Tutorials - Body Tag and Block Level Tags

By: FYICenter.com

Part:   1  2  3  4  5   6 

(Continued from previous part...)

Can Images Be Included in PRE Elements?

Yes. In-line elements can be included pre elements. So images can be included in pre elements with img elements. Here is a good example of img elements in pre elements:

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>The XHTML Validation Icon</title>
 </head>
 <body>
<pre>
If you know your Web page is a valid XHTML document,
you should include this image, <img 
src="http://www.w3.org/Icons/valid-xhtml10" 
alt="Valid XHTML 1.0 Strict" height="31" width="88" />
on your page to show your readers that
you have taken care to create an interoperable page.
</pre>
 </body>
</html>

If you save the above document as image.html, and view it with Internet Explorer, you will see that an impage is displayed in the pre-formatted text paragraph as shown below:
            Images in PRE Elements

What Is a BLOCKQUOTE Tag/Element?

A blockquote element is a block level element that can be used directly as a sub-element in the body element. You can use blockquote elements to specify a block of paragraphs to be displayed in a quotation format. Here are basic rules about blockquote elements:

  • "blockquote" elements can only have block elements as contents.
  • "blockquote" elements can have empty contents.
  • "blockquote" elements can not have PCDATA as contents.
  • "blockquote" elements can not have in-line elements contents.
  • "blockquote" elements are block elements. They can not be used as in-line elements.
  • "blockquote" elements are displayed with extra left margin and right margin.

Here is a good example of blockquote elements:

 <body>
  <blockquote><p>
  "You may never know what results come of your action,
  but if you do nothing there will be no result."
  </p></blockquote>
 </body>

Can BLOCKQUOTE Elements Be Nested?

Yes. Blockquote elements can be directly nested. This allows you to include one quote inside another quote. Below is a good example of nested blockquote elements:

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>Nested BLOCKQUOTE Elements</title>
 </head>
 <body>

 <p>William Shakespeare was an English poet and playwright
 widely regarded as the greatest writer of the English 
 language. One of his best-known and most quoted plays is:</p>
 
 <blockquote>
 <p>Hamlet - The revenge of Prince Hamlet, 
 whose father, the late King of Denmark, victor over 
 the Polish army, died suddenly while Hamlet was away 
 from home at Wittenberg University. The most famous
 quote of the play:</p>

 <blockquote><p>
 "To be or not to be, that is the question."
 </p></blockquote>
 </blockquote>

 </body>
</html>

If you save the above document as nest_quotes.html, and view it with Internet Explorer, you will see that nest blockquote elements work nicely giving double extra margins to the inner blockquote element as shown below:
            Nested BLOCKQUOTEs

(Continued on next part...)

Part:   1  2  3  4  5   6 


Selected Developer Jobs:

More...