我正在尝试更改 ASP.Net 网页中 Treeview 节点的 CSS 样式和颜色。我可以更改字体大小,但无法更改节点的颜色。请你帮助我好吗?
<style type="text/css">
.treeNode {
color: #070707;
font: 14px Arial, Sans-Serif;
}
.rootNode {
font-size: 18px;
width: 100%;
color: #f00;
}
.leafNode {
padding: 4px;
color: #070707;
}
.selectNode {
font-weight: bold;
}
</style>
<asp:TreeView ID="tvData" runat="server" OnSelectedNodeChanged="tvData_SelectedNodeChanged" ShowLines="True">
<LeafNodeStyle CssClass="leafNode" />
<NodeStyle CssClass="treeNode" />
<RootNodeStyle CssClass="rootNode" />
<SelectedNodeStyle CssClass="selectNode" />
<Nodes>
<asp:TreeNode Text="Root" Value="0">
<asp:TreeNode Text="Products">
<asp:TreeNode Text="First Product" />
<asp:TreeNode Text="Second Product" />
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>