Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Menu Align CenterMenu Align Center
Previous
 
Next
New Post
1/26/2011 1:59 PM
 
Does anyone know where to set the menu alignment?  I am simply trying to center the main menu in the default skin, but cannot find the right spot to change this in the CSS.

Any ideas?

Steve
 
New Post
2/9/2011 8:08 AM
 
I think you could wrap the menu in a div and then centre the div using css. Hope this helps Marcel
 
New Post
2/9/2011 11:00 AM
 
Depends on which Menu Provider you're using and the attributes. For most my current menus, I've been using the DNNNav provider with the RenderMode set to display it as an Unordered List. In this case, you can apply the css rule  margin:auto   to the main class of the menu and that should align all the menu items to the center.

So the menu control in the ASCX file looks like this:
<dnn:NAV runat="server" id="dnnNav" csscontrol="MainNav" IndicateChildren="false" ProviderName="DNNMenuNavigationProvider">
    <CustomAttributes>
        <dnn:CustomAttribute Name="RenderMode" Value="UnorderedList" />
    </CustomAttributes>
</dnn:NAV>

And the CSS would look like this (keep in mind, you'll have to adjust the attributes for your project this is a direct copy of one of my projects:

.MainNav {
    font-family: Arial, sans-serif;
    font-size: 13px;
    width:620px;
    margin: auto;
    padding: 0;
    line-height: 25px;
}
 
.MainNav .root {
    display:block;
    float:left;
    list-style:none;
}
 
.MainNav .root.first a {
 
}
 
.MainNav .mi a{
    display:block;
    color:#666;
    font-size:14px;
    text-decoration:none!important;
    padding-left: 10px;
    padding-right: 10px;
    border-left: 1px solid #FFF;
    border-right: 1px solid #FFF;
}
 
.MainNav .root a:hover{
    color:#F57B20;
    border-left: 1px solid #CCCCCC;
    border-right: 1px solid #CCCCCC;
}
 
.MainNav .m {
    z-index: 9999;
    padding: 0px;
    margin:0px;
 
}
 
.MainNav .m .mi {
    background-color:#FFFFFF;
    text-align: left;
 
}
 
.MainNav ul.m {
    border: 1px solid #ccc;
    padding-left:0px;
}
 
.MainNav .m .mi a {
    border: none;
    padding: 2px 15px 2px 15px;
    color:#666;
}
 
.MainNav .m  a:hover {
    color:#F57B20;
}


Wells Doty Jr
Online Content Development
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Menu Align CenterMenu Align Center


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out