The easiest way to add a class to the server element is to add the Cssclass = "" parameter and specify which classes you want to add, for example:
<asp:SiteMapPath ID="SiteMap1" runat="server" PathSeparator=" > " ParentLevelsDisplayed="1" PathDirection="RootToCurrent" RenderCurrentNodeAsLink="false" ShowToolTips="true" CssClass="breadcrumb"> </asp:SiteMapPath>
However, due to how the SiteMapPath server control generates markup, you will need to make some additional changes to your control, as well as to the Bootstrap breadcrumb class.
First, the SiteMapPath server control has a PathSeparator property that lets you specify which character separates links. If none is specified, it will use the default angle bracket. The bootstrap breadcrumb class uses a slash to separate links, so you need to change the PathSeparator property from PathSeparator = ">" to PathSeparator = "/".
Next, you will need to create a Node template for the SiteMapPath server element. This will say that SiteMapPath controls which template each Node should run, and allows us to tell it to do this instead of li:
<asp:SiteMapPath ID="SiteMap1" runat="server" PathSeparator=" / " ParentLevelsDisplayed="1" PathDirection="RootToCurrent" RenderCurrentNodeAsLink="false" ShowToolTips="true" CssClass="breadcrumb"> <NodeTemplate> <li> <asp:HyperLink id="lnkPage" Text='<%# Eval("Title") %>' NavigateUrl='<%# Eval("Url") %>' ToolTip='<%# Eval("Description") %>' Runat="server" /> </li> </NodeTemplate> </asp:SiteMapPath>
Finally, you will need to modify the breadcrumb class to include SiteMapPath controls in your attachment:
.breadcrumb > span > li { display: inline-block; } .breadcrumb > span > li > a:active { color: #999999; }
source share