How do I style the item in a asp:menu

Discussion in 'ASP .Net' started by Tony, Oct 30, 2011.

  1. Tony

    Tony Guest

    I just wonder how do I style the text that is the actual node items.
    I have created a web.sitemap that looks like this and further down is the
    default.aspx.
    As you can see I have an id on the asp:menu but I don't know how to style
    the contents of the asp:menu

    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode title="Home" description="Start page" url="Default.aspx" >
    <siteMapNode title="About Us" description="About us" url="About.aspx"
    />
    <siteMapNode title="Products" description="Our products"
    url="Products.aspx" />
    <siteMapNode title="Contact Us" description="Contact us"
    url="Contact.aspx" />
    </siteMapNode>
    </siteMap>

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs"
    Inherits="slask._default" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
    #menu
    {
    float:left;
    margin-bottom:25px;
    width: 350px;
    height: 30px;
    }
    </style>
    </head>

    <body>
    <form id="form1" runat="server">
    <div id="menu">
    <asp:Menu ID="Menu1" runat="server"
    DataSourceID="SiteMapDataSource1"
    Orientation="Horizontal" SkipLinkText=""
    StaticDisplayLevels="2">
    </asp:Menu>

    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
    </div>
    </form>
    </body>
    </html>

    //Tony
    Tony, Oct 30, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3R1?=

    menu control setting indvidual style item

    =?Utf-8?B?U3R1?=, Nov 10, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    359
    =?Utf-8?B?U3R1?=
    Nov 10, 2006
  2. Replies:
    0
    Views:
    1,432
  3. RJN
    Replies:
    0
    Views:
    2,114
  4. QUASAR
    Replies:
    6
    Views:
    418
    QUASAR
    Jan 17, 2004
  5. mwr

    ASP.Menu in IE6, cannot select menu item when...

    mwr, Jun 16, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    258
Loading...

Share This Page