ABSTRACT

The positioning of elements at the desired points on a page is crucial in achieving the intended design. Since Hypertext Markup Language (HTML) elements are typically displayed by default to the left of the page and design layouts require more than this, the need for positioning them in Web design is a foregone conclusion. This chapter presents the Cascading Style Sheet (CSS) properties used for positioning elements. Static positioning is the default method used by browsers for positioning HTML elements and represents the normal flow of elements on a page, where the elements are displayed in the order as they appear in an HTML document. Relative positioning places an element in relation to where it would have been placed in a normal flow. Absolute positioning removes an element from the ­normal flow of elements without leaving behind the space it had occupied, so that it no longer influences the positions of other elements. Sticky positioning is a combination of relative and fixed positioning.