Click here to Skip to main content
16,016,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,
I am using the following CSS for a treeview in my webpage:

CSS
.treeview, .treeview ul {
    padding: 0 0 0 10px;
    margin: 0;
    list-style: none;
    width: 10%;
}

.treeview ul {
    background-color: transparent;
    margin-top: 4px;
}


.treeview .hitarea {
    background: url(images/treeview-default.gif) -64px -25px no-repeat;
    height: 16px;
    width: 16px;
    margin-left: -16px;
    float: left;
    cursor: pointer;
    padding-left: 0;
}
/* fix for IE6 */
* html .hitarea {
    display: inline;
    float:none;
}

.treeview li {
    margin: 0;
    padding: 3px 0pt 3px 16px;
}

.treeview LI:hover
{
    text-decoration:none;
}

.treeview LI:hover UL LI
{
    text-decoration:none;
}

.treeview a.selected {
    color: Maroon;
}

#treecontrol { margin: 1em 0; display: none; }

.treeview .hover { color: red; cursor: pointer; }

.treeview li { background: url(images/treeview-default-line.gif) 0 0 no-repeat; }
.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }

.treeview .expandable-hitarea { background-position: -80px -3px; }

.treeview li.last { background-position: 0 -1766px }
.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); }
.treeview li.lastCollapsable { background-position: 0 -111px }
.treeview li.lastExpandable { background-position: -32px -67px }

.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }


Here, I want to change the color of all the nodes to "white" which is now blue by default.

Can any one please suggest me regarding this?


Thanks & Regards,
Posted

1 solution

Are you using ASP.NET Treeview? You didn't include the HTML control things in your question. If ASP.NET Treeview then see this

CSS
.clsWhite { color: White; }

ASP.NET
<asp:treeview runat="server" xmlns:asp="#unknown">
     <nodestyle cssclass="clsWhite" /><!--This one is enough, the below elements are optional(If you want to show different style then apply different classes there)-->
     <rootnodestyle cssclass="clsWhite" />
     <parentnodestyle cssclass="clsWhite" />
     <leafnodestyle cssclass="clsWhite" />
     <hovernodestyle cssclass="clsWhite" />
     <selectednodestyle cssclass="clsWhite" />
</asp:treeview>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900