Float paragraph in HTML and CSS

Description

The following code shows how to float paragraph.

Example


<html>
<head>
<style type='text/css'>
p {<!--   w ww . ja  v a  2 s.c om-->
float: left;
border: 1px solid black;
padding: 10px;
background: rgb(218, 218, 218);
margin: 10px;
}
</style>
</head>
<body>
<p>
This is the text of the first paragraph.
</p>
<p>
This is the text of the second paragraph.
</p>
<p>
This is the text of the third paragraph.
</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

Float paragraph 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...