Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add borders to menus

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I have this menu and when I click an item there are no borders around the items that drop down, so it looks unprofessional. Can someone tell me how to add a border to the drop down items?
Code:
                <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" StaticItemFormatString="{0}"
                    StaticPopOutImageUrl="images/separator1.jpg" style="left: 0px; top: 32px" BackColor="#FFFBD6" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#990000" StaticSubMenuIndent="10px">
                    <StaticMenuItemStyle BorderColor="Blue" BorderStyle="Solid" BorderWidth="2px" HorizontalPadding="5px" VerticalPadding="2px" />
                    <Items>
                        <asp:MenuItem NavigateUrl="MenuBehaviors_cs.aspx" Text="Home" Value="Home"></asp:MenuItem>
                        <asp:MenuItem Text="Executive Summary" Value="Executive Sumary"></asp:MenuItem>
                        <asp:MenuItem NavigateUrl="MenuBehaviors_cs.aspx" Text="Capabilities" Value="Capabilities">
                            <asp:MenuItem NavigateUrl="MenuBehaviors_cs.aspx" Text="Construction Management"
                                Value="Construction Management"></asp:MenuItem>
                            <asp:MenuItem NavigateUrl="MenuBehaviors_cs.aspx" Text="Environmental Engineering"
                                Value="Environmental Engineering"></asp:MenuItem>
                            <asp:MenuItem Text="Indoor Air Quaility" Value="Indoor Air Quaility"></asp:MenuItem>
                            <asp:MenuItem Text="Lead Consulting" Value="Lead Consulting"></asp:MenuItem>
                            <asp:MenuItem Text="Health and Safety Audits" Value="Health and Safety Audits"></asp:MenuItem>
                            <asp:MenuItem Text="Process Engineering" Value="Process Engineering"></asp:MenuItem>
                            <asp:MenuItem Text="Asbestos" Value="Asbestos"></asp:MenuItem>
                        </asp:MenuItem>
                        <asp:MenuItem NavigateUrl="MenuBehaviors_cs.aspx" Text="News" Value="News"></asp:MenuItem>
                        <asp:MenuItem Text="Careers" Value="Careers">
                            <asp:MenuItem Text="Jacksonville, FL" Value="Jacksonville, FL"></asp:MenuItem>
                            <asp:MenuItem Text="Tampa, FL (HQ)" Value="Tampa, FL (HQ)"></asp:MenuItem>
                        </asp:MenuItem>
                        <asp:MenuItem NavigateUrl="~/contactus.htm" Text="Contact Us" Value="Contact Us"></asp:MenuItem>
                    </Items>
                    <DynamicHoverStyle BackColor="#990000" ForeColor="White" />
                    <DynamicMenuStyle BackColor="#FFFBD6" />
                    <StaticSelectedStyle BackColor="#FFCC66" />
                    <DynamicSelectedStyle BackColor="#FFCC66" />
                    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                    <StaticHoverStyle BackColor="#990000" ForeColor="White" />
                </asp:Menu>

DougP, MCP, A+
 
The best option is to use CSS instead of all those inline attributes you've set. I think a menu control will render a a table in which case you could target the elements by their td tag and set the border in CSS e.g.
Code:
#myMenu td
{
  border: 1px solid #000;
}


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top