<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/XHTML1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> position play </title>
<style type="text/css">
#rightward { width:20em; float:right; border: solid 1px red; }
#wont_position_1 { left:50px; background-color:cyan; }
#wont_position_2 { left:50px; background-color:magenta; }
#will_position { position:relative; left:50px; width:20em; background-color:yellow; }
</style>
</head>
<body>
<div id="outer_enclosure">
<h1>position play</h1>
<div id='rightward'>This 'floats' to the right, on top of other stuff.</div>
<p id="wont_position_1">
This is some text in a 'p' tag.
Since this element has display=inline by default.
you can't position it. But if I put enough text here,
you'll see it wrap around the float. At least, that's
what it's supposed to do. Your browser may put it
on the moon, after all.
</p>
<div id="wont_position_2">
This is in a 'div' tag which uses display=block formatting.
But it won't position, either, because the default position=static
ignores where the left boundry is set.
</div>
<div id="will_position">
Finally, *something* that can be positioned, because
(a) it has display:block and (b) it doesn't have position:static.
</div>
</div> <!-- end outer_enclosure -->
</body>
</html>
syntax highlighted by Code2HTML, v. 0.93pm6