Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Richter - 24 Jun 2007 20:02 GMT
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>
Mark Rae - 24 Jun 2007 20:11 GMT
>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;">

Signature

http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.