O'Reilly logo

Web Design in a Nutshell by Jennifer Niederst

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required