ASP.NET - Trying to centre a css menu (miniflex)

Asked By Annie X
03-Feb-12 07:15 AM
Hi hope you can help
I have a menu below that is in a ascx file which is then displayed in a webpage. The problem i have is that i cannot centerise the menu.

I have made changes to the code in the css, the webpage and the ascx file. I have used extra div tags and now i don't no what to do.
 
Any ideas what might be the problem?

Many thanks Annie X 

.wrapper .MenuArea{

width:1000px;

 

height:31px;

min-height:31px;

 

max-height:31px;

padding:9px 0px 0px 0px;}


<div class="MenuArea">

<uc1:NavTopMenu id="NavTopMenu" runat="server"/>

</div>



<%@ Control Language="VB" AutoEventWireup="false" CodeFile="NavTopMenu.ascx.vb" Inherits="Components_NavTopMenu" %>

<style type="text/css" media="screen">
#miniflex {
 padding:0px 0px 0px 0px; margin:0px 0px 0px 0px; border-top:0px; border-right:0px; border-bottom:none 0px; border-left:0px; font-size:small; float:left; display:inline; background-color:Lime;
}
#miniflex LI {
 padding:0px 0px 0px 0px; margin:0px 0px 0px 0px; display:inline; float:left; list-style-type:none;
}
#miniflex A:link {
 font-size:12px; font-family:Verdana, Arial, sans-serif; float:left; color:#333; line-height:16px; text-decoration:none;
      padding:0px 9px 0px 8px;
      margin:0px 0px 0px 0px;     
      border-right:solid 1px #dedede;
      }
#miniflex A:visited {
 padding:0px 9px 2px 8px; margin:0px 0px 0px 0px; font-size:12px; font-family:Verdana, Arial, sans-serif; float:left; border-right:solid 1px #dedede; color:#333; line-height:16px; text-decoration:none;
}
#miniflex A.active:link {
 padding:0px 9px 2px 8px; margin:0px 0px 0px 0px; color:#333; border-bottom:#333 3px solid; border-right:solid 1px #dedede;
}
#miniflex A.active:visited {
 padding:0px 9px 2px 8px; margin:0px 0px 0px 0px; color:#333; border-bottom:#333 3px solid; border-right:solid 1px #dedede;
}
#miniflex A:hover {
 padding:0px 9px 2px 8px; margin:0px 0px 0px 0px; color:#333; border-bottom:#FF0101 3px solid; border-right:solid 1px #dedede;
}
</style>

 
<span id="miniflex">
    <asp:LinkButton ID="link1" runat="server" Text="link 1" CausesValidation="false"></asp:LinkButton>   
    <asp:LinkButton ID="link2" runat="server" Text="link 2" CausesValidation="false"></asp:LinkButton>
    <asp:LinkButton ID="link3" runat="server" Text="link 3" CausesValidation="false"></asp:LinkButton>
    <asp:LinkButton ID="link4" runat="server" Text="link 4" CausesValidation="false"></asp:LinkButton>
    <asp:LinkButton ID="link5" runat="server" Text="link 5" CausesValidation="false"></asp:LinkButton>
</span>

  D Company replied to Annie X
03-Feb-12 07:21 AM
Hello Friend.

ul.MenuBarHorizontal a {
 text-align: center;
}


and again if you are using any sub menu than set its align to left should work. for more help see this http://labs.adobe.com/technologies/spry/samples/menubar/CenteringHorizontalMenuBarSample.html

Regards
D
  Annie X replied to D Company
03-Feb-12 07:36 AM
thanks for the help. I'm not sure what to do here.
  Ahi I replied to Annie X
03-Feb-12 07:41 AM

.wrapper .MenuArea{

width:1000px;

margin:auto;    /* add this u ll get that menu center*/

 

height:31px;

min-height:31px;

 

max-height:31px;

padding:9px 0px 0px 0px;}



  Annie X replied to Ahi I
03-Feb-12 07:49 AM
sorry it didn't work
  Ahi I replied to Annie X
03-Feb-12 07:58 AM
First u cut all div and following below concept....

Example:

<div style="margin:auto; width:1000px; border:solid">/* here dont give any float:left*/
ur content goes here
</div>

Check it first... after that u ll get idea how to design ur page...
Create New Account
help
Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B A) What is scavenging? (B) What are different types of caching using cache object of ASP.NET? (B) How can you cache different version of same page using ASP.NET cache object? (A) How will implement Page Fragment Caching? (B) Can you compare ASP.NET sessions with classic ASP? (B) Which are the various modes of storing ASP.NET session
in Sql server as var_name int How do you separate business logic while creating an ASP.NET application? There are two level of asp.net debugging 1. Page level debugging For this we have to edit the page level debugging The control itself will take care of the date display How can you deploy an asp.net application ? You can deploy an ASP.NET Web application using any one of the following three deployment options. a) Deployment using VS
Migration from ASP to ASP.net How to convert ASP site to ASP.NET site using C# http: / / www.asp.net / downloads / archived-v11 / migration-assistants / asp-to-aspnet hi, ASP.NET framework is very much different from unstrucured ASP and there is no correct way to
Tracing in ASP.NET? hi all, what is tracing? how to achieve tracing in asp.net? different ways of doing tracing? thanks and regards Aman Khan hi. . Tracing in ASP.NET 2.0 Tracing is a way to monitor the execution of your ASP.NET application. You can record exception details and program flow in a way that doesn't
session is user based mean u can differentiate login user in different way • Process independent. ASP.NET session state is able to run in a separate process from the ASP.NET host process. If session state is in a separate process, the ASP.NET process can come and go while the session state process remains available. Of course, you ASP, too. • Support for server farm configurations. By moving to an out-of-process model, ASP.NET also solves the server farm problem. The new out-of-process model allows all servers