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

XHTML Tutorial - Getting Extra Space between Paragraphs

By: FYIcenter.com

(Continued from previous topic...)

How To Get Extra Space between Paragraphs?

By default, browsers will give a predefined white space between two paragraphs. But if you want some extra white space between two paragraphs, you can enter an extra paragraph with a   entity.

Note that a true empty paragraph will not give any extra white space. See the following tutorial XHTML document:

<?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>Extra Space between Paragraphs</title>
 </head>
 <body>
  <p>Row, row, row your boat,
  Gently down the stream.</p>
  <p></p>
  <p>Merrily, merrily, merrily, merrily,
  Life is but a dream.</p>
  <p>&nbsp;</p>
  <p>Frère Jacques, Frère Jacques, 
  Dormez vous? Dormez vous?
  Sonnez les matines, Sonnez les matines,
  Din, din, don! Din, din, don!</p>
 </body>
</html>

If you save the above document as space.html, and view it with Internet Explorer, you will see that the empty paragraph gives no extra white space. But the paragraph with a &nbsp; entity does give the extra white space you wanted as shown below:
            Space between Paragraphs

(Continued on next topic...)

  1. What Is the "body" Tag/Element?
  2. What Is Wrong with My "body" Elements?
  3. What Elements Are Allowed as Body Sub-Elements?
  4. What Attributes Are Allowed in the Body Element?
  5. What Is a "p" Tag/Element?
  6. Can I Mix Images with Text in a Paragraph?
  7. How To Control Line Breaks in a Paragraph?
  8. How To Highlight One Part of a Paragraph?
  9. How To Get Extra Space between Paragraphs?
  10. What Is Wrong with My "p" Elements?
  11. What Is a "pre" Tag/Element?
  12. Are Tab Characters Preserved in a "pre" Element?
  13. Can Images Be Included in "pre" Elements?
  14. What Is a "blockquote" Tag/Element?
  15. Can "blockquote" Elements Be Nested?
  16. What Are Heading Tags/Elements?
  17. What Are "hr" Tags/Elements?
  18. What Are Other Block Elements?


Selected Developer Jobs:

More...