Jump to content

[SOLVED] SpryMenuBar CSS Issues


godster

Recommended Posts

Hi guys.

 

I am working on as site at the moment and experimenting with Dreamweavers own Spry widget to add a horizontal drop-down menu.

 

This seems to be causing some really strange issues with the other elements on that page, for example, breaking the layout as between my #wrapper and #footer, not allowing me to set margins between two nested divs, not allowing me to insert background images using CSS.

 

All in all, very frustrating....

 

I have modified the style sheet for the Spry widget slightly but cannot imagine I would have caused this.

 

One thing worht mentioning is that when previewed in Dreamweaver, there is a white box that represents the cluster of drop down nav items, which hangs under the nav bar and in preview seems to be forcing other elements down the page. Obviously I need to retain this sub menu though for the drop down to function as hoped.

 

Any suggestions/advice would be great.

 

@charset "UTF-8";

/* SpryMenuBarHorizontal.css - Revision: Spry Preview Release 1.4 */

/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */

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

LAYOUT INFORMATION: describes box model, positioning, z-order

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

/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
{
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
cursor: default;
width: auto;
font-weight: bolder;
}
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
{
z-index: 1000;
}
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
{
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
position: relative;
text-align: center;
cursor: pointer;
width: 150px;
float: left;
height: 45px;
font-family: Geneva, Arial, Helvetica, sans-serif;
visibility: visable;
}
/* 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: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: 8.2em;
position: relative;
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: 150px;
height: 45px;
}
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
{
position: relative;
margin: -31% 0 0 100%;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
{
left: auto;
top: 0;
}

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

DESIGN INFORMATION: describes color scheme, borders, fonts

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

/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
{
border: 1px solid #CCC;
}
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
{
display: block;
cursor: pointer;
padding: 0.5em 0.75em;
color: #FFFFFF;
text-decoration: none;
background-image: url(../images/blank_button.gif);
height: 25px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
text-transform: uppercase;
padding-top: 15px;
}
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
{
color: #CCCCCC;

}
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
{
color: #CCCCCC;
}

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

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%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
{
background-image: url(../images/blank_button_down.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
}
/* 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%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
{
background-image: url(../images/blank_button_right.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
}
/* 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%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
{
background-image: url(../images/blank_button.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
}
/* 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%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
{
background-image: url(../images/blank_button.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;
}
}

Link to comment
Share on other sites

check and see if there's repeated class names, etc..

any repeated things will break your code

also, i advise a backward check: paste the spry code on a blank page and add the other page's elements one at a time and test the page until you find what's conflicting.

thats what i always do and end up fixing it

 

f\loat: left;

 

on the bottom could possibly be up the code

Link to comment
Share on other sites

Thanks ricmental but aside from checking for duplicate classes is there an easier option to diagnose the fault without having to reconstruct the entire page?

 

The point i mentioned with respect to the box outline for the sub item menu, is this of any significance? It seems like something there is pushing the other elements down the page and outside of the wrapper.

 

At a bit of a loss to be honest, other than pulling the whol spry menu out and starting from scratch!

 

 

Link to comment
Share on other sites

thats too much code where i dont know some tag meanings, so i cant figure out whats wrong by looking at the code.

 

if you dont know the code either, then you have to do backward testing until you can find the errors,

 

or learn the code

 

or wait until someone else replies ;)

 

 

Link to comment
Share on other sites

cleaned CSS:

@charset "UTF-8";
@media screen,projection
{
ul.MenuBarHorizontal li.MenuBarItemIE {
display:inline;
float:left;
background:#FFF;
}
}

ul.MenuBarHorizontal {
list-style-type:none;
font-size:100%;
cursor:default;
width:auto;
font-weight:bolder;
margin:0;
padding:0;
}

ul.MenuBarActive {
z-index:1000;
}

ul.MenuBarHorizontal li {
list-style-type:none;
font-size:100%;
position:relative;
text-align:center;
cursor:pointer;
width:150px;
float:left;
height:45px;
font-family:Geneva, Arial, Helvetica, sans-serif;
visibility:visable;
margin:0;
padding:0;
}

ul.MenuBarHorizontal ul {
list-style-type:none;
font-size:100%;
z-index:1020;
cursor:default;
width:8.2em;
position:relative;
left:-1000em;
border:1px solid #CCC;
margin:0;
padding:0;
}

ul.MenuBarHorizontal ul.MenuBarSubmenuVisible {
left:auto;
}

ul.MenuBarHorizontal ul li {
width:150px;
height:45px;
}

ul.MenuBarHorizontal ul ul {
position:relative;
margin:-31% 0 0 100%;
}

ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible {
left:auto;
top:0;
}

ul.MenuBarHorizontal a {
display:block;
cursor:pointer;
color:#FFF;
text-decoration:none;
background-image:url(../images/blank_button.gif);
height:25px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
text-transform:uppercase;
padding:15px 0.75em 0.5em;
}

ul.MenuBarHorizontal a.MenuBarItemSubmenu {
background-image:url(../images/blank_button_down.gif);
background-repeat:no-repeat;
background-position:95% 50%;
}

ul.MenuBarHorizontal ul a.MenuBarItemSubmenu {
background-image:url(../images/blank_button_right.gif);
background-repeat:no-repeat;
background-position:95% 50%;
}

ul.MenuBarHorizontal iframe {
position:absolute;
z-index:1010;
}

ul.MenuBarHorizontal a:hover,ul.MenuBarHorizontal a:focus,ul.MenuBarHorizontal a.MenuBarItemHover,ul.MenuBarHorizontal a.MenuBarItemSubmenuHover,ul.MenuBarHorizontal a.MenuBarSubmenuVisible {
color:#CCC;
}

ul.MenuBarHorizontal a.MenuBarItemSubmenuHover,ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover {
background-image:url(../images/blank_button.gif);
background-repeat:no-repeat;
background-position:95% 50%;
}

Link to comment
Share on other sites

Hi darkfreaks.

 

So should I just try your cleaned version of the code instead? What exactly was cleaned out of what was there previously?

 

I have ruled out the positioning of the spry menu by removing it completely and then previewing the page. Having done this, it resulted in the same issues and would therefore conclude that was not the problem.

 

That is not to say though that it is not something that is conflicting in the spry.css!

 

Issues i'm still having are some strange positioning problems as between the #wrapper and #footer.

 

Strange positioning of a nested div tag, containing a heading which cannot be explained in the sites main.css.

 

Inability to add images in the css to that nested tag to create the effect of rounded corners for the element.

 

It would seem to me that CSS elsewhere is ovrriding the properties of these page elements and having strange effects.

 

Most frustrating....

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.