0 Replies Latest reply on Nov 27, 2008 6:00 AM by iimia

    Help with Spry dropdown menu

    iimia
      I desperatelt need help with some vertical alignment problem i'm having with a dropdown menu i've created.

      I cannot get the text in the dropdowns to align centrally in the vertical plane.

      The html for the page is as follows:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns=" http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Welcome to Inshore Independent Financial Advisers - Highcliffe, Hampshire. Tel 01425 282181</title>
      <link href="inshore.css" rel="stylesheet" type="text/css" />
      <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
      <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
      </head>

      <body>
      <div id="container">

      <div id="header"></div>

      <div id="logo"><div id="freecons"><img src="graphics/freecons.jpg" /></div></div>

      <div id="topnav">
      <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a href="#"><span>Home</span></a></li>
      <li><a href="#" class="MenuBarItemSubmenu"><span><span>About Us</span></span></a>
      <ul>
      <li><a href="#">Introduction</a></li>
      <li><a href="#">Expertise</a></li>
      <li><a href="#">Team</a></li>
      </ul>
      </li>
      <li><a class="MenuBarItemSubmenu" href="#"><span><span>Services</span></span></a>
      <ul>
      <li><a href="#">Savings &amp; Investments</a> </li>
      <li><a href="#">Equity Release</a></li>
      <li><a href="#">Estate Planning</a></li>
      <li><a href="#">Family Protection</a></li>
      <li><a href="#">Pre-Retirement</a></li>
      <li><a href="#">At Retirement</a></li>
      <li><a href="#">Long Term care</a></li>
      <li><a href="#">For Business</a></li>
      </ul>
      </li>
      <li><a href="#"><span>eSmartmoney</span></a></li>
      <li><a href="#"><span>Links</span></a></li>
      <li><a href="#"><span>Contact Us</span></a></li>
      </ul>
      </div>

      <div id="mainContent">
      <h1> Main Content </h1>
      <h2>H2 level heading </h2>
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id, libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
      </div>
      <div id="footer"></div>

      </div>



      </div>
      <script type="text/javascript">
      <!--
      var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
      //-->
      </script>
      </body>
      </html>

      and the CSS for the Spry menu is here:

      @charset "UTF-8";


      ul.MenuBarHorizontal
      {
      margin: 0;
      padding: 0;
      list-style-type: none;
      font-size: 12px;
      cursor: default;
      width: auto;
      background: url(../graphics/topnav/topnavbg.jpg) no-repeat 0 0;
      }
      ul.MenuBarActive
      {
      z-index: 1000;
      }

      ul.MenuBarHorizontal li
      {
      margin: 0;
      padding: 0;
      list-style-type: none;
      font-size: 12px;
      position: relative;
      text-align: left;
      cursor: pointer;
      width: 150px;
      float: left;
      background: url(../graphics/topnav/topnavbg.jpg);
      }
      /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
      ul.MenuBarHorizontal ul
      {
      margin: 0;
      padding: 1px 0 0 0;
      list-style-type: none;
      font-size: 12px;
      z-index: 1020;
      cursor: default;
      width: 150px;
      position: absolute;
      left: -1000em;
      }
      /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
      ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
      {
      left: auto;
      }
      /* Menu item containers are same fixed width as parent */
      ul.MenuBarHorizontal ul li
      {
      width: 148px;
      position: relative;
      border-bottom: 1px solid #9A9A9A;
      border-left: 1px solid #9A9A9A;
      border-right: 1px solid #9A9A9A;
      }
      /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
      /* Menu items are a light gray block with padding and no text decoration */
      ul.MenuBarHorizontal a
      {
      display: block;
      cursor: pointer;
      color: #FFFFFF;
      text-decoration: none;
      text-align: center;
      overflow: hidden;
      height: 30px;
      background-image: url(../graphics/topnav/topnavbg.jpg);
      background-repeat: no-repeat;
      background-position: 0;
      }
      ul.MenuBarHorizontal a span {
      display: block;
      padding: 7px 10px 7px 10px;
      }
      ul.MenuBarHorizontal a span span {
      background: none;
      }
      ul.MenuBarHorizontal li ul li {
      border-bottom-width: 1px;
      border-bottom-style: solid;
      border-bottom-color: #9A9A9A;
      }
      ul.MenuBarHorizontal li ul a {
      background-image: url(../graphics/topnav/topnavbghover.jpg);
      display: block;
      width: 148px;
      }

      ul.MenuBarHorizontal /* Menu items that have mouse over or focus have a blue background and white text */
      a.MenuBarItemHover ,ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
      {
      background: url(../graphics/topnav/topnavbghover.jpg) no-repeat 0 0;
      }
      ul.MenuBarHorizontal a.MenuBarItemHover span, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover span {
      background: url(../graphics/topnav/topnavbghover.jpg);
      }
      ul.MenuBarHorizontal /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
      ul a.MenuBarItemHover,ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal ul a.MenuBarSubmenuVisible
      {
      color: #0079BD;
      background: url(../graphics/topnav/topnavbghover.jpg) repeat-y 0 0;
      }
      ul.MenuBarHorizontal /*******************************************************************************

      SUBMENU INDICATION: styles if there is a submenu under a given menu item

      *******************************************************************************/

      /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
      a.MenuBarItemSubmenu span
      {
      padding-bottom: 6px;
      padding-top: 6px;

      }
      ul.MenuBarHorizontal a.MenuBarItemSubmenu span span {


      Background: url(../graphics/topnav/topnavbghover.jpg) no-repeat right 50% display: block
      padding-top: 1px;
      padding-right: 0;
      padding-bottom: 1px;
      padding-left: 0;
      padding-top: 1px;
      }
      ul.MenuBarHorizontal /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
      a.MenuBarItemSubmenuHover span span
      {
      background-image: url(SpryMenuBarRightHover.gif);
      background-repeat: no-repeat;
      background-position: 95% 50%;
      }

      /*******************************************************************************

      BROWSER HACKS: the hacks below should not be changed unless you are an expert

      *******************************************************************************/

      /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
      ul.MenuBarHorizontal iframe
      {
      position: absolute;
      z-index: 1010;
      }
      /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
      @media screen, projection
      {
      ul.MenuBarHorizontal li.MenuBarItemIE
      {
      display: inline;
      f\loat: left;
      background: #FFF;
      }
      }

      I have tried everything to make it vertically align center but it just won't happen.

      here is a link to the page:

      http://skpdesign.co.uk.preview.ohwebs.co.uk/spry/

      Please, please help......