title: apply custom styles to anchor tag inside div from code behind
body: <p>here i want to apply custom styles to anchor tag inside div from code behind.
  here is my code.here am applying several styles. font family is applying but font color and font size is not applying</p>
  
  <pre><code>&lt;div id="sidenav" style="height:600px" runat="server"&gt;
              &lt;ul id="abcd" runat="server" style="margin-top:30px;"&gt;
                  &lt;li&gt;&gt;&lt;a href="ViewEvents.aspx"&gt;Events&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&gt;&lt;a href="PhotoGalleries.aspx"&gt;Photo Galleries&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&gt;&lt;a href="InProgress.aspx"&gt;Location&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&gt;&lt;a href="InProgress.aspx"&gt;Officials&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&gt;&lt;a href="InProgress.aspx"&gt;Honours Board&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&gt;&lt;a href="InProgress.aspx"&gt;History&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&gt;&lt;a href="InProgress.aspx"&gt;Links&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&gt;&lt;a href="InProgress.aspx"&gt;Site map&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&gt;&lt;a href="InProgress.aspx"&gt;Help&lt;/a&gt;&lt;/li&gt;                    
              &lt;/ul&gt;
               &lt;span id="myspan" runat="server"&gt;&amp;nbsp;&lt;/span&gt;
          &lt;/div&gt;
   foreach (Control c in sidenav.Controls)
              {
                  string abc = abcd.InnerText;
                  abcd.InnerHtml = "&lt;font ForeColor='" + objpage.NavigatioinTextcolor + "'&gt;" + abc;
                  //abc.Style.Add("color", objpage.NavigatioinTextcolor);
              }
                  abcd.Style.Add("background-color", objpage.NavigationBackcolor);
                  ////abcd.Style.Add("ForeColor", objpage.NavigatioinTextcolor);
                  ////sidenav.Style.Add("color", objpage.NavigatioinTextcolor);
                  ////sidenav.Style.Add("ForeColor", objpage.NavigatioinTextcolor);
                  abcd.Style.Add("font-family", objpage.NavigatioinTextStyle);
                  abcd.Style.Add("font-size", objpage.NavigatioinTextsize);
                  abcd.Style.Add("font-size", string.Format(objpage.NavigatioinTextsize + "px"));
                  abcd.Style.Add("style", "font-size:" + string.Format(objpage.NavigatioinTextsize + "px"));
  </code></pre>