Left float and right float : float « Layout « HTML / CSS






Left float and right float

 
<html>
<head>

<title>Left float and right float</title>
<style type="text/css">
.leftFloat {
 float: left
}
.rightFloat {
 float: right
}
p {
 clear: left;
}

</style>
</head>

<body>
  <img src="http://www.java2s.com/style/logo.png" class="leftFloat" alt="cover" />

  <p>This is the book cover for the <em>CSS</em>.</p>
  <img src="http://www.java2s.com/style/logo.png" class="rightFloat" alt="cover"/>

  <p>This is the book cover for the <em>CSS</em>.</p>
</body>
</html>

 








Related examples in the same category

1.float left
2.float left and right
3.float left and right, three columns
4.float left and right with other content
5.float multiple floats
6.left float with padding
7.Positioning: float right and left
8.Using Float Positioning
9.Float H2 tag to left
10.Set extra content to float left
11.Float left with text wrapper around
12.Float right with text wrapper around
13.nested float
14.float control: default margin padding
15.float extra box properties
16.float highlighted dimensions
17.float highlighted, dimensions multiple paragraph
18.float inline becomes block
19.float inline becomes block with inline padding
20.float inline becomes block multiline inline box model