Offsetting Elements in the Natural Flow

Each element has a natural location in a page’s flow. Moving the element with respect to this original location is called relative positioning. The surrounding elements are not affected—at all.

Figure 11.25. Although the date is aligned to the right, it is on a separate line than the header element and thus appears below it.

To offset elements within the natural flow:

1.
Type position: relative; (don’t forget the semicolon; the space is optional).
2.
If desired, type top, right, bottom, or left. Then, type :v, where v is the desired distance that you want to offset the element from its natural location, ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.