Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 24th, 2006, 07:02 PM
Friend of Wrox
Join Date: Feb 2006
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default Menu control adding 1px padding underneath in IE

I am using the asp.net 2.0 Menu web control to present a dynamic menu in a website. The menu has no data source and is not bound to anything. I am using strictly as a hard coded dynamic menu for navigation only. In Firefox, it looks fine, but in IE, the menu is putting in some additional vertical height in somewhere. I normally wouldn't care so much about 1px but in this case this menu is for a public website for which we paid a lot of money for a professional graphic design company to make a whole corporate logo and design for us, so we really want to stick to it and make it look great.

Here is the code for the menu control as I have it configured now:

                <div class="columnContainer">

                    <div class="wideColumn" id="primaryNavBar">
                        <div><asp:Menu ID="mnPrimaryNav" runat="server" 

                                    <asp:MenuItem NavigateUrl="~/AboutUs.aspx" Text="About Us" />
                                    <asp:MenuItem Selectable="false" Text="Careers">
                                        <asp:MenuItem NavigateUrl="~/Careers/ExperiencedHires/Default.aspx" Text="Experienced Hires"></asp:MenuItem>
                                        <asp:MenuItem NavigateUrl="~/Careers/CollegeRecruiting/Default.aspx" Text="College Recruiting"></asp:MenuItem>
                                    <asp:MenuItem NavigateUrl="~/ContactUs.aspx" Text="Contact" />
                                    <asp:MenuItem NavigateUrl="~/Events.aspx" Text="Events" />
                                    <asp:MenuItem Selectable="false" Text="Services">
                                        <asp:MenuItem NavigateUrl="~/Services/Accounting/Default.aspx" Text="Accounting Services"></asp:MenuItem>
                                        <asp:MenuItem NavigateUrl="~/Services/Forensics/Default.aspx" Text="Forensics"></asp:MenuItem>
                                        <asp:MenuItem NavigateUrl="~/Services/InternalAudit/Default.aspx" Text="Internal Audit"></asp:MenuItem>
                                        <asp:MenuItem NavigateUrl="~/Services/ITAssurance/Default.aspx" Text="IT Assurance"></asp:MenuItem>
                                        <asp:MenuItem NavigateUrl="~/Services/Research/Default.aspx" Text="Research"></asp:MenuItem>
                                        <asp:MenuItem NavigateUrl="~/Services/TaxConsulting/Default.aspx" Text="Tax Consulting"></asp:MenuItem>
Here are the three relevant styles:

div.primaryNav {
    height: 28px;
    border-bottom: 1px solid #8E7F67;
    margin-bottom: 0px;
    padding-bottom: 0px;

div.columnContainer {
    width: 760px;
    display: table-row; 

div.wideColumn {
    width: 558px;
    float: left;

.primaryNavBtns {
    border-left: 1px solid #827461;
    height: 28px;

I want the menu to be exactly 28px in height, no more, no less. Any help or advice anyone could offer would be greatly appreciated!


Neil Timmerman
Veris Consulting
Old August 31st, 2006, 10:19 AM
Friend of Wrox
Join Date: Feb 2006
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts

By the way, in case anyone reads this for the future, I didnt find the real solution but I hacked my way around it with some CSS:

On the Menu, I set the StaticMenuItemStyle-CssClass="primaryNavBtns".

Here is that class:

.primaryNavBtns {
    border-left: 1px solid #827461;
    height: 28px;
    margin-bottom: -1px;
    padding: 0px 2px 0px 2px;

Neil Timmerman
Veris Consulting

Similar Threads
Thread Thread Starter Forum Replies Last Post
adding images to the menu kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 September 18th, 2007 01:48 PM
Adding Menu Items using VB SamuelP ASP.NET 2.0 Professional 0 October 23rd, 2006 08:01 AM
Adding menu to dialog bar. lmadhavi Visual C++ 2 October 4th, 2004 02:08 AM
Adding a menu to ChildWindow lmadhavi Visual C++ 2 August 31st, 2004 05:24 AM
Adding a picture to the Menu Editor donrafeal Pro VB Databases 0 April 22nd, 2004 03:21 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.