Positioning with Style Sheets
In August of 1997, the W3C published its working draft of specifications for style sheet properties for positioning HTML elements on the page and in three-dimensional space. This greater control over object placement can be used for more tightly designed static page layout as well as for creating and tracking motion effects with DHTML.
This effort was initiated by Netscape and Microsoft, who began supporting some positioning properties in their 4.0 version browsers. The positioning concepts and properties were picked up and developed further in the CSS, Level 2 specification, which was released in May of 1998.
Style sheet positioning is a rich and complex topic that is beyond the scope of this chapter, however, this section aims to introduce some basic positioning concepts.
For complete positioning information, see the W3C’s CSS2 specification online at http://www.w3.org/TR/REC-CSS2. A good overview is provided by Eric Meyer in his article, “Playing for Position,” in WebReview magazine (http://webreview.com/wr/pub/98/02/06/feature/index3.html).
The position Property
The position
property has three possible values:
absolute, relative, and
static.
It works in conjunction with the top
and
left
properties (used for specifying distances
from the top and left starting point), and with the
width and height properties (for specifying the width and height of the element including its padding and border). Values for these properties can be specified as either length ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access