O'Reilly logo

Web Programming with HTML5, CSS, and JavaScript by Dean

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

5.10 Relative Positioning

In the previous section, you learned about absolute positioning, where you specify position: absolute in a CSS rule in order to position an element relative to the top-left corner of its containing block. As an alternative, you can position an element relative to its normal flow within its surrounding content. That’s called relative positioning. Take a look at the Divine Comedy web page in FIGURE 5.20, where we use relative positioning to move “height of ecstasy” up and “depths of despair” down.

FIGURE 5.20 Divine ...

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