Menu control has spacing problem

Discussion in 'ASP .Net Web Controls' started by Wowotoe, Mar 14, 2007.

  1. Wowotoe

    Wowotoe Guest

    I'm trying to implement the Menu control on VS2005. The menu looks
    great in Vertical mode. However, there are some weird spacing issues
    when in Horizontal mode. Seems like spaces are inserted between each
    menu item and separator. I specified all the horizontal-padding I can
    find to be "0px" and in CSS margin: 0px and padding: 0px. But the
    spacings are still there.

    I did a search on Google and there are few other people having the
    same issue but none of them have good reply that solve this mystery.

    Any help will be much appreciated. Thanks.

    Below is a sample of my codes.


    <style type="text/css">
    <!--
    ..test-NavLeft {
    background-image: url(navimg_left.gif);
    height: 30px;
    width: 4px;
    padding: 0px;
    margin: 0px;
    background-repeat: repeat-x;
    }
    ..test-NavRootItem {
    background-image: url(navimg_bg.gif);
    height: 30px;
    background-repeat: repeat-x;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 0px;
    padding-bottom: 0px;
    margin: 0px;
    }
    ..test-NavRight {
    background-image: url(navimg_right.gif);
    height: 30px;
    width: 4px;
    padding: 0px;
    margin: 0px;
    }
    -->
    </style>


    <asp:Menu ID="mnu_Sample1" runat="server" Orientation="Horizontal"
    StaticEnableDefaultPopOutImage="false" StaticMenuItemStyle-
    ItemSpacing="0" StaticMenuItemStyle-HorizontalPadding="0"
    StaticMenuStyle-HorizontalPadding="0">
    <StaticItemTemplate>
    <table cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="test-NavRootItem"><%# Eval("Text") %></td>
    </tr>
    </table>
    </StaticItemTemplate>

    <DynamicItemTemplate>
    <table cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="test-NavLeft">
    </td>
    <td class="test-NavRootItem">
    <%# Eval("Text") %>
    </td>
    <td class="test-NavRight">
    </td>
    </tr>
    </table>
    </DynamicItemTemplate>



    <Items>
    <asp:MenuItem Text="Monkey" ToolTip="monkey likes to play
    baseball" SeparatorImageUrl="navimg_divider.gif"></asp:MenuItem>
    <asp:MenuItem Text="Bananas" ToolTip="monkey likes to play
    baseball">
    <asp:MenuItem Text="Sub-Menu 1" ToolTip="monkey likes
    to play baseball" />
    <asp:MenuItem Text="Sub-Menu 2" ToolTip="monkey likes
    to play baseball" />
    <asp:MenuItem Text="Sub-Menu 3" ToolTip="monkey likes
    to play baseball">
    <asp:MenuItem Text="Sub-Sub-Menu 1"
    ToolTip="monkey likes to play baseball" />
    <asp:MenuItem Text="Sub-Sub-Menu 2"
    ToolTip="monkey likes to play baseball" />
    </asp:MenuItem>
    </asp:MenuItem>
    </Items>
    </asp:Menu>
     
    Wowotoe, Mar 14, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KatB
    Replies:
    4
    Views:
    865
  2. Guest

    spacing problem with a JTree

    Guest, Dec 2, 2003, in forum: Java
    Replies:
    2
    Views:
    1,928
    Guest
    Dec 4, 2003
  3. Replies:
    1
    Views:
    680
    SwissCheese
    Dec 21, 2003
  4. Frogleg

    Problem with spacing

    Frogleg, Dec 10, 2004, in forum: HTML
    Replies:
    2
    Views:
    377
    Frogleg
    Dec 10, 2004
  5. Replies:
    2
    Views:
    9,130
    www.clubpath.com
    May 26, 2008
Loading...

Share This Page