Added support for absolutely and relatively positioned elements

Fixes #1