<div align=center> also affects align of dynamic dropdown item text

Discussion in 'ASP .Net' started by Steve Richter, Jun 24, 2007.

  1. I am using <div align=center> to center a horizontal menu on the page.
    Problem is the center align of the div is rippling down to the menu
    items and causing the text of the dynamic popup sub menu items to be
    centered also. How can I center my navigation menu without centering
    the menu item text?

    thanks,

    -Steve


    <div align=center>
    <asp:menu id="NavigationMenu"
    staticdisplaylevels="2"
    staticsubmenuindent="10"
    orientation="Horizontal"
    target="_blank" StaticMenuItemStyle-ItemSpacing="1em"
    StaticEnableDefaultPopOutImage=false
    runat="server">

    <dynamicmenustyle backcolor="LightSkyBlue" HorizontalPadding="1em"
    forecolor="Black"
    borderstyle="Solid"
    borderwidth="1"
    bordercolor="Black" />

    <items>
    <asp:menuitem navigateurl="Home.aspx"
    text="Home"
    tooltip="Home">
    <asp:menuitem navigateurl="Music.aspx"
    text="Music"
    tooltip="Music">
    <asp:menuitem navigateurl="Classical.aspx"
    text="Classical"
    tooltip="Classical"/>
    <asp:menuitem navigateurl="Rock.aspx"
    text="Rock"
    tooltip="Rock"/>
    <asp:menuitem navigateurl="Jazz.aspx"
    text="Jazz"
    tooltip="Jazz"/>
    </asp:menuitem>
    <asp:menuitem navigateurl="Movies.aspx"
    text="Movies"
    tooltip="Movies">
    <asp:menuitem navigateurl="Action.aspx"
    text="Action"
    tooltip="Action"/>
    <asp:menuitem navigateurl="Drama.aspx"
    text="Drama"
    tooltip="Drama"/>
    <asp:menuitem navigateurl="Musical.aspx"
    text="Musical"
    tooltip="Musical"/>
    </asp:menuitem>
    </asp:menuitem>
    </items>

    </asp:menu>
    </div>
     
    Steve Richter, Jun 24, 2007
    #1
    1. Advertising

  2. Steve Richter

    Mark Rae Guest

    "Steve Richter" <> wrote in message
    news:...

    >I am using <div align=center> to center a horizontal menu on the page.
    > Problem is the center align of the div is rippling down to the menu
    > items and causing the text of the dynamic popup sub menu items to be
    > centered also. How can I center my navigation menu without centering
    > the menu item text?


    The easiest and most reliable way is to stop using deprecated syntax such as
    align=center... :) There is absolutely no guarantee at all how long this
    will continue to be supported by subsequent browser versions...

    Instead, you should seriously consider making your HTML markup
    XHTML-compliant.

    In this specific case, you need:

    <div style="margin-left:auto;margin-right:auto;">


    --
    http://www.markrae.net
     
    Mark Rae, Jun 24, 2007
    #2
    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. Kay
    Replies:
    2
    Views:
    7,167
  2. Ben Amada

    Replacement for <div align="center">

    Ben Amada, Nov 30, 2005, in forum: ASP .Net
    Replies:
    11
    Views:
    16,291
    Ben Amada
    Dec 1, 2005
  3. Sypher
    Replies:
    22
    Views:
    99,354
    xarzu
    Oct 19, 2011
  4. Beck
    Replies:
    3
    Views:
    911
    David Dorward
    Nov 11, 2005
  5. Gernot Frisch

    center div over another div

    Gernot Frisch, Mar 16, 2006, in forum: Javascript
    Replies:
    1
    Views:
    187
    Randy Webb
    Mar 16, 2006
Loading...

Share This Page