title: Adding style to asp.net label
body: <p>I want to adding style to asp.net label, but it wont work.</p>
  
  <pre><code>ASP.NET Mark up
  &lt;asp:Label runat="server" ID="lblCommentText"/&gt;
  
  Generated from the backend: Html mark up
  &lt;span id="ctl02_ctl36_CommentText"&gt;Only the leave the comment please&lt;/span&gt;
  
  ............................................
  </code></pre>
  
  <p>I want to add the following style to the label</p>
  
  <pre><code>{
   float:right;
   width:70%;
  }
  </code></pre>
  
  <p>I've tried using</p>
  
  <ol>
  <li><p>cssClass property</p></li>
  <li><p>Add this <code>lblCommentText.Attributes.CssStyle.Add("float", "right");</code> to backend</p></li>
  <li><p>using javascript<br>
  <code>document.getElementById('&lt;%= lblCommentText.ClientID%&gt;').Style.display = ("float","right");</code></p></li>
  <li><p>and also in-line style to the element</p></li>
  </ol>
  
  <p>none of them works, can someone help me out ?</p>