13 Replies Latest reply: Dec 12, 2012 7:36 PM by Ben Pleysier RSS

    Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.

    KCoverick

      I have set up a spry menu in my page.  file:///C:/Users/Kim/Documents/PQH_xhtml/index.html

       

      Everything works great in Chrome and Firefox. Just not in IE.  The only problem I am having is in IE the drop down menus stretch out all the way across the page.

       

      I have tried changing the width, but it messes up Chrome and Firefox.  Just need IE to shorten up the width of sub menus.

       

      Any help is GREATLY appreciated!!!

        • 1. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
          Ben Pleysier CommunityMVP

          The reason is the auto width sub-menu items.

           

          To get the correct setting for IE you need the following style rules, where !important is not a remark, but needs to be included

          ul.MenuBarHorizontal ul li {

              display: block;

              float: none !important;

              width: auto;

              white-space: nowrap;

          }

          • 2. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
            KCoverick Community Member

            Thank you very much!  This setting in the style rules has stopped the drop down submenus from going across the whole screen.  I was wondering...is there any way that I can get IE to have the same drop down width as the Chrome and Firefox?  Those sub menus drop down wonderfully, the same size as the main menu button.  Just wondering.  Again, thanks for your help.

            • 3. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
              Ben Pleysier CommunityMVP

              Please upload the site and supply a link to it

              • 4. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                KCoverick Community Member

                Please excuse my ignorance.  I am just learning this and am working with Dreamweaver CS6.  How do I upload the site and supply link to it. 

                • 5. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                  KCoverick Community Member

                  Help :[  Okay, so the Spry Menu Bar is looking and seems to be working okay except for a couple of tweeks.  I have looked all over and just need a quick

                  tip from someone who is more experienced than I with Dreamweaver and coding.

                   

                  In Google and Firefox, width of the drop down menu boxes is great, however the text goes beyond the box.  At one time, I had it so the text continued onto the next line and the box height adjusted accordingly.  That way the drop down boxes were all still the same as the parent (main) box.

                   

                  In IE the text is all in the dd box, but the boxes are different widths to accomodate the text.  Again, like above, I would like to have the text continue on to the next line and the box height adjust as needed.  All my drop down boxes should be the same width as my main menu button (box).

                   

                  I am not sure how to show it here, since it is still only a work in progress on my computer. 

                   

                  Any help will be greatly appreciated!!!

                  • 6. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                    Ben Pleysier CommunityMVP

                    The answer to your problem can only be found in the code (HTML, CSS and JS).

                     

                    The out-of-the-box SpryMenyBar works well. It is when one makes changes in the code that the problems arise. Have a look here

                    http://www.dwcourse.com/dreamweaver/ten-commandments-spry-menubars.php#one

                     

                    May I assume that you have made no changes in the JS file and that the changes in the HTML file will not cause the problems. In which case, the problem probably lies in the CSS. It will therefore be a good idea to copy and paste the CSS file in your next reply.

                    • 7. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                      KCoverick Community Member

                      This is the  styles.css

                       

                       

                      @charset "utf-8";
                      /* Simple fluid media
                         Note: Fluid media requires that you remove the media's height and width attributes from the HTML
                         http://www.alistapart.com/articles/fluid-images/
                      */
                      img, object, embed, video {
                      max-width: 100%;
                      }
                      /* IE 6 does not support max-width so default to width 100% */
                      .ie6 img {
                      width:100%;
                      }

                      /*
                      Dreamweaver Fluid Grid Properties
                      ----------------------------------
                      dw-num-cols-mobile:  4;
                      dw-num-cols-tablet:  10;
                      dw-num-cols-desktop: 15;
                      dw-gutter-percentage: 15;

                      Inspiration from "Responsive Web Design" by Ethan Marcotte
                      http://www.alistapart.com/articles/responsive-web-design

                      and Golden Grid System by Joni Korpi
                      http://goldengridsystem.com/
                      */

                      /* Mobile Layout: 480px and below. */

                      .gridContainer {
                      margin-left: auto;
                      margin-right: auto;
                      width: 96.7391%;
                      padding-left: 1.6304%;
                      padding-right: 1.6304%;
                      background-color: #f9f8f6;
                      }
                      #LayoutDiv1 {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #navigation {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #exterior_pic {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #welcome {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #interior_pic {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #bottom_nav {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #footer {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }

                      /* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */

                      @media only screen and (min-width: 481px) {
                      .gridContainer {
                      width: 98.6956%;
                      padding-left: 0.6521%;
                      padding-right: 0.6521%;
                      }
                      #LayoutDiv1 {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #navigation {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #exterior_pic {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #welcome {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #interior_pic {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #bottom_nav {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #footer {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      }

                      /* Desktop Layout: 769px to a max of 1232px.  Inherits styles from: Mobile Layout and Tablet Layout. */

                      @media only screen and (min-width: 769px) {
                      .gridContainer {
                      width: 99.1304%;
                      max-width: 1232px;
                      padding-left: 0.4347%;
                      padding-right: 0.4347%;
                      margin: auto;
                      }
                      #LayoutDiv1 {
                      clear: both;
                      float: left;
                      margin-left: 0px;
                      width: 98%;
                      display: block;
                      border-top-width: 10px;
                      border-right-width: 10px;
                      border-bottom-width: 10px;
                      border-left-width: 10px;
                      border-top-style: double;
                      border-right-style: double;
                      border-bottom-style: none;
                      border-left-style: double;
                      border-top-color: #3b87d5;
                      border-right-color: #3b87d5;
                      border-bottom-color: #3b87d5;
                      border-left-color: #3b87d5;
                      margin-top: 10px;
                      margin-right: 1px;
                      padding-top: 5px;
                      padding-right: 3px;
                      padding-bottom: 0px;
                      }
                      #navigation {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #exterior_pic {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #welcome {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #interior_pic {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #bottom_nav {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      #footer {
                      clear: both;
                      float: left;
                      margin-left: 0;
                      width: 100%;
                      display: block;
                      }
                      }

                      • 8. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                        KCoverick Community Member

                        @charset "UTF-8";

                        /* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */

                        /* 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;
                        background-color: #f9f8f6;
                        font-family: Georgia, "Times New Roman", Times, serif;
                        font-weight: bold;
                        font-style: oblique;
                        }
                        /* 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: left;
                        cursor: pointer;
                        width: 14.28%;
                        float: left;
                        }
                        /* 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: 100%;
                        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
                        {
                        float: none;
                        clear:left;
                        width: auto;
                        white-space: nowrap;
                        }
                        /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
                        ul.MenuBarHorizontal ul ul
                        {
                        position: absolute;
                        margin: -5% 0 0 95%;
                        }
                        /* 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;
                        background-color: #EEE;
                        padding: 0.5em 0.75em;
                        color: #333;
                        text-decoration: none;
                        border: thick ridge #3b87d5;
                        }
                        /* Menu items that have mouse over or focus have a blue background and white text */
                        ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
                        {
                        background-color: #33C;
                        color: #FFF;
                        }
                        /* 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
                        {
                        background-color: #33C;
                        color: #FFF;
                        }

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

                        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(SpryMenuBarDown.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(SpryMenuBarRight.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(SpryMenuBarDownHover.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(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;
                        filter:alpha(opacity:0.1);
                        }
                        /* 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;
                        }
                        }

                        • 9. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                          KCoverick Community Member

                          I have copied and pasted the styles.css and  the Spry MBH.css.  Thank you so much for your help.  Everything but the spry MB

                          has been wonderful!

                          • 10. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                            Nancy O. CommunityMVP

                            Spry Menus were never designed to work with Fluid Grid layouts.  They pre-date them by several years.

                             

                            As an FYI: Spry framework is no longer being developed by Adobe and is being phased out from future products.  So the best advice I can offer you is to find a better menu system, preferably one that is responsive to work with your responsive layouts.

                             

                            CSS Menu Systems

                             

                             

                             

                             

                             

                             

                            Nancy O.

                            • 11. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                              Ben Pleysier CommunityMVP

                              As much as I hate to admit it, Nancy is correct.

                               

                              But being the lover of Spry that I am, have a look at the following.

                               

                              Change the widths in the following to auto


                              ul.MenuBarHorizontal li

                              ul.MenuBarHorizontal ul

                              ul.MenuBarHorizontal ul li

                               

                              and add the highlighted to ul.MenuBarHorizontal ul li

                              width: auto;

                              display: block;

                              float: none !important;

                              width: auto;

                              white-space: nowrap;

                              • 12. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                                KCoverick Community Member

                                Should I stay away from fluid grid layout?  Will it conflict with things like slideshows and lightboxes?? I will try to find another nav menu other than spry.  Thanks for the list.

                                • 13. Re: Help with IE drop down menu stretching across page, Chrome & Firefox work perfectly.
                                  Ben Pleysier CommunityMVP

                                  You are best off at mastering what you are doing now.

                                   

                                  Once you have a website that you like and has the functionality that you need, then you can go ahead and experiment with responsive web design which includes fluid layouts.