Archive for 'Absolute and relative positions' Category

Absolute and relative positions

By Steve Monas - Last updated: Sunday, June 13, 2010

The first step in creating menus or navigation elements is to decide on the location and to create the skeletal structure of the menu or navigation bar. Menu and navigation elements are defined in a div tag. The div tag is absolutely or relatively positioned later according to the need of the web page. Elements [...]

Example of an absolutely positioned vertical menu construction

By Steve Monas - Last updated: Sunday, June 13, 2010

Begin by defining the menu div as below: #menu {width: 12em; background: #eee} The use of em tags will take care of the width of the menu to the container div. This also resolves IE’s box-model problems. All the block elements inside this div will fill the containers width by default. The em widths will [...]