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, ...Centering the dnnNAV MenuCentering the dnnNAV Menu
Previous
 
Next
New Post
11/15/2010 4:47 PM
 
OK,  here is the HTML around the menu.

<div class="menu_template_center">
    <object id="dnnNAV" codetype="dotnetnuke/server" codebase="NAV">
        <param name="ProviderName" value="DNNMenuNavigationProvider" />
        <param name="IndicateChildren" value="false" />
        <param name="ControlOrientation" value="Horizontal" />
        <param name="ControlAlignment" value="Center" />
        <param name="CSSControl" value="mainMenu" />
    </object>
</div>

And here is the CSS

.menu_template_center{
    width:980px;
    display:table-cell;
    text-align:center;
}
 
.mainMenu
{
    cursor:pointer;
    font-size: 11px;
    background-color:transparent;
    margin-left: auto;
    margin-right: auto;
}

You can see the result on the following page:

http://fortsmithschools.org.dnnmax.co...

I use both Firebug and IE Developer Toolbar to look at the code and still can't see why it won't center.  Please let me know what I'm doing wrong.

Thanks in advance.



 
New Post
11/15/2010 6:09 PM
 
You may need to simplify and not use the display: table stuff. It's not necessary and the extra wrappers are just extra code to weigh things down. I used firebug to turn some of those off, but still couldn't get it to center. For some reason, the menu doesn't highlight in firebug when the menu code is hovered in the html view window. It does on my site doing a similar set up and the menu centers. If you want to look at my demo site to use firebug to see what I've done, feel free to copy the framework, nothing patented there. You can see how simple it should be. Maybe it is the combo of the nesting and the css table settings that is causing problems for you. I'd try to remove the nesting and let it display as normal div's and span's. I also don't set widths except on the row and the "skin width" wrapper, and let the menu shrink down inside the span so the span tag around the menu is what actually gets centered. Hope that helps. http://www.dnnstyle.com/cleanblue/Home.aspx

JOHN GIESY
DotNetNuke Hosting Expert

DotNetNuke 7 Hosting $70 /year
DNN4Less.com Team DotNetNuke  

New Post
11/15/2010 6:15 PM
 
PS. The "control alignment" param won't have any effect, last I knew it wasn't implemented in the dnn nav menu, so that can safely be deleted from the object code.

JOHN GIESY
DotNetNuke Hosting Expert

DotNetNuke 7 Hosting $70 /year
DNN4Less.com Team DotNetNuke  

New Post
11/16/2010 11:13 AM
 
OK, here is what I have now, but it still won't center.

http://fortsmithschools.org.dnnmax.co...

HTML

<div class="menurow">
    <div class="skinwidth">
        <div class="menuarea">
            <object id="dnnNAV" codetype="dotnetnuke/server" codebase="NAV">
                <param name="ProviderName" value="DNNMenuNavigationProvider" />
                <param name="IndicateChildren" value="false" />
                <param name="ControlOrientation" value="Horizontal" />
                <param name="CSSControl" value="mainMenu" />
            </object>
        </div>
    </div>
</div>

CSS

.menurow {
    background: url(images/menu_bg.png) repeat-x top left;
    height:38px;
    text-align:center;
    min-width: 960px;
    width: 100%;
    margin: 0px;
    padding: 0px;
}
 
.skinwidth {
    text-align: center;
    margin: 0px auto;
    padding: 0px;
    width:980px;
    display:block;
    background: none transparent scroll repeat 0% 0%;
    overflow: visible;
    border-bottom: 0px;
    border-left: 0px;
    border-top: 0px;
    border-right: 0px;
}
 
.menuarea {
     
}
 
.mainMenu
{
    cursor:pointer;
    font-size: 11px;
    background-color:transparent;
    margin: 0px;
    padding: 0px;
    overflow: visible;
    vertical-align: middle;
}

This is slowly driving me mad and we're supposed to launch the site tomorrow.
 
New Post
11/16/2010 11:23 AM
 
FOUND IT!

There was a float:left in the ."mainMenu .root" class.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Centering the dnnNAV MenuCentering the dnnNAV Menu


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