CSS Float Right
Posted on 10. Jan, 2010 by CSSFloat in Examples
Floating an element right is exactly like floating left, except the code is
{float: right;} ie. #floatrightexample {float: right;}
This time we’re going to be floating an image that already has its width defined. Hence, there’s no need to include the width in the CSS code.
Also, did you notice the change in the CSS code?
We used a ‘#’ instead of a ‘.’. This simply refers whether we’re using id or class, this is important for creating valid CSS.
The html code will look something like this…
<img id=”floatrightexample” src=”images/image.png” height=”100″ width=”100″ alt=”CSS float right example” border=”0″ />

