Precise positioning: Width

  1. List style types
  2. Precise positioning
  3. Position: absolute

If we want to position this menu on the side of the page, it can’t have a width that goes all the way across the page.

image 18Add a width to ul#menu:

ul#menu {

background-color: tan;

border: solid .1em grey;

padding-left: 0;

width: 16em;

}

And while we’re at it, let’s reduce the padding on the inner list:

ul#menu ol {

padding-left: 1em;

}

And add some padding to the headlines:

ul#menu h3 {

background-color: orange;

padding-left: .3em;

}

That’s starting to look perfectly reasonable as a menu. The next thing to do is to move it up the page.

  1. List style types
  2. Precise positioning
  3. Position: absolute