By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,835 Members | 1,488 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,835 IT Pros & Developers. It's quick & easy.

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

P: n/a
I am using <div align=centerto 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>

Jun 24 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Steve Richter" <St************@gmail.comwrote in message
news:11**********************@m36g2000hse.googlegr oups.com...
>I am using <div align=centerto 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

Jun 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.