My ListBox on the aspx page is displayed like this:
<asp:ListBox ID="ddlItems" runat="server" Style="padding: 2px; width: 210px; height:200px;">
</asp:ListBox>
To add a background image to my list items in the code behind, I am using the following code which works perfectly:
myListItem.Attributes.Add("style", "background-image:url('www.mysite.com/images/Gradient/" + ds.Tables[0].Rows[iGroups]["Backgroundimage"].ToString() + "');");
Now, I have been struggling to make the list items' font bold and white in color. Additionally, how can I adjust the height of the list items and increase the font size?
I have tried the following approaches, but they are not working as expected:
myListItem.Attributes.Add("ForeColor", "White");
myListItem.Attributes.Add("style", "font-weight:bold");