Demonstrate White Space Collapsing and Line Wrapping in HTML and CSS

Description

The following code shows how to demonstrate White Space Collapsing and Line Wrapping.

Example


<html>
<body>
<p>This    paragraph shows how   multiple
<!--  w  ww . ja v a  2s  . c  om-->
spaces      between     words are treated as

a single space.

It is known as white space collapsing, and the big spaces between    some of the
words will not appear    in the browser.


It also demonstrates how the browser will treat multiple
carriage returns (new lines) as a single space, too.</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

Demonstrate White Space Collapsing and Line Wrapping in HTML and CSS
Home »
  HTML CSS Tutorial »
    Text »
      Paragraph
HTML CSS Tutorial Paragraph
Add line break to a paragraph in HTML and C...
Add margin to paragraph in HTML and CSS
Add shading border for paragraph in HTML an...
Create Paragraphs in HTML and CSS
Create three Paragraphs in HTML and CSS
Demonstrate White Space Collapsing and Line...
Float a paragraph right and make text above...
Float image to left and right, then start n...
Float paragraph in HTML and CSS
Set text align for paragraph to center in H...
Use different border style to highlight wor...
Use margin to align and move a paragraph in...