skip to content

An enlarging unordered list


Information

Just a simple menu to produce an enlarging effect with a drop shadow on hover.

Again this is just a css styled unordered list using no images that will degrade well for text only browsers.

20th November 2005

A second list added to show how a background image can be used to make a more realistic shadow.

Cascading Style Sheet

MENU ONE

#painters {
  padding:0;
  margin:5em 0;
  list-style-type:none; 
  }
#painters li {
  width:75px; 
  height:20px; 
  float:left;
  border:1px solid #000;
  margin-right:2px;
  }
#painters a em {
  font-style:normal; 
  font-size:1em; 
  line-height:1.5em;
  }
#painters a {
  text-decoration:none;
  color:#000;
  position:absolute; 
  width:75px; 
  height:20px; 
  display:block;
  text-align:center;
  }
#painters a.red {background:#c00; color:#fff;}
#painters a.orange {background:#fc0; color:#000;}
#painters a.yellow {background:#ee0; color:#000;}
#painters a.green {background:#080; color:#fff;}
#painters a.blue {background:#00c; color:#fff;}
#painters a:hover {
  width:120px; 
  height:28px;
  z-index:200;
  background:#aaa;
  }
#painters a:hover em {
  font-size:1.5em;
  line-height:1.1em;
  overflow:hidden;
  cursor:pointer;
  background:#fff; 
  border:1px solid #000;
  position:absolute; 
  width:120px; 
  height:25px;
  left:-12px; 
  top:-8px;
  }
#painters a:hover.red em {background:#c00;}
#painters a:hover.orange em {background:#fc0;}
#painters a:hover.yellow em {background:#ee0;}
#painters a:hover.green em {background:#080;}
#painters a:hover.blue em {background:#00c;}

Cascading Style Sheet

MENU TWO

#painters2 {
  padding:0;
  margin:0;
  list-style-type:none; 
  }
#painters2 li {
  width:75px; 
  height:20px; 
  float:left;
  border:1px solid #000;
  margin-right:2px;
  }
#painters2 a em {
  font-style:normal; 
  font-size:1em; 
  line-height:1.5em;
  }
#painters2 a {
  text-decoration:none;
  color:#000;
  position:absolute; 
  width:75px; 
  height:20px; 
  display:block;
  text-align:center;
  }
#painters2 a.red {background:#c00; color:#fff;}
#painters2 a.orange {background:#fc0; color:#000;}
#painters2 a.yellow {background:#ee0; color:#000;}
#painters2 a.green {background:#080; color:#fff;}
#painters2 a.blue {background:#00c; color:#fff;}
#painters2 a:hover {
  width:120px; 
  height:28px;
  z-index:200;
  background:transparent url(../ads/opaque.gif);
  }
#painters2 a:hover em {
  font-size:1.5em;
  line-height:1.1em;
  overflow:hidden;
  cursor:pointer;
  background:#fff; 
  border:1px solid #000;
  position:absolute; 
  width:120px; 
  height:25px;
  left:-12px; 
  top:-4px;
  }
#painters2 a:hover.red em {background:#c00;}
#painters2 a:hover.orange em {background:#fc0;}
#painters2 a:hover.yellow em {background:#ee0;}
#painters2 a:hover.green em {background:#080;}
#painters2 a:hover.blue em {background:#00c;}

xhtml

MENU ONE

<ul id="painters">
  <li><a class="red" href="#nogo"><em>Monet</em></a></li>
  <li><a class="orange" href="#nogo"><em>Constable</em></a></li>
  <li><a class="yellow" href="#nogo"><em>Renoir</em></a></li>
  <li><a class="green" href="#nogo"><em>Turner</em></a></li>
  <li><a class="blue" href="#nogo"><em>Matisse</em></a></li>
</ul>

xhtml

MENU TWO

<ul id="painters2">
  <li><a class="red" href="#nogo"><em>Monet</em></a></li>
  <li><a class="orange" href="#nogo"><em>Constable</em></a></li>
  <li><a class="yellow" href="#nogo"><em>Renoir</em></a></li>
  <li><a class="green" href="#nogo"><em>Turner</em></a></li>
  <li><a class="blue" href="#nogo"><em>Matisse</em></a></li>
</ul>

Copyright

You may use this method on your personal 'non-profit' web site without seeking my permission. A link back to CSSplay is always appreciated.

Commercial usage is also permitted without seeking approval, but I would ask that a donation is considered to support my work on CSSPlay.

If you are having problems integrating any of my demonstrations into your website then I now offer a service to fault find and correct any errors that you may have introduced. Please email me for more information.




CSS play recommend

Social Media Applications On DemandFlash LoadedCreative stock imagesDHTML menu & Javascript menu creator - Powerful web menu solutionsPSD to HTML, PSD to XHTML Service by PSD2HTML.com. You Design - We XHTML / CSS.SitegrinderFree, practical CSS menus, layouts, and examplesBitrix Site Manager