10-14-2009, 05:55 AM
One of the commonly-seen layout, especially in large websites displaying ads, is wrapping the text around an advertising block. This is accomplished using the float property. 
The float property has three possible values: 'left', 'right', and 'none'. Let's take a look at the following examples:
Example 1: Given the CSS declaration,
the following HTML,
renders,
SCREENSHOT:
------------
[attachment=365]
Example 2: Given the CSS declaration,
the following HTML,
renders,
SCREENSHOT:
---------------
[attachment=366]
Notice the presence of the width property increases the spacing between the image and the text.
---
Thank You
The float property has three possible values: 'left', 'right', and 'none'. Let's take a look at the following examples:
Example 1: Given the CSS declaration,
Code:[Highlight]
#leftfloat { 
  float:left; 
}the following HTML,
Code:[Highlight]
<span id="leftfloat"><img src="yp.jpg"></span>This example illustrates how float:left affects the appearance of a block. Notice how the image "floats" to the left.renders,
SCREENSHOT:
------------
[attachment=365]
Example 2: Given the CSS declaration,
Code:[Highlight]
#rightfloat { 
  float:right; 
  width:50px; 
}the following HTML,
Code:[Highlight]
<span id="rightfloat"><img src="yp.jpg"></span>This example illustrates how float:left affects the appearance of a block. Notice how the image "floats" to the right.renders,
SCREENSHOT:
---------------
[attachment=366]
Notice the presence of the width property increases the spacing between the image and the text.
---
Thank You
