Gravity animates HTML page elements using the laws of physics. It uses the Box2DWeb library to animate given page elements so they move, rotate, and collide. The gravity acceleration and direction are configurable. Given callback functions may be invoked when objects collide. Objects' speed and rotation may be affected when the user drags them using the mouse pointer. Each page element can be made static or animated. Animated page elements may include the respective children elements. The elements' friction and density properties can also be configured.