title: Add Css to dynamically created label and textbox
body: <p>I am dynamically creating the label and textbox in my C# code and am having issues with css formatting. Since the label and textbox are generated separately adding css to it to float left and add padding has been a challenge. I am new to c# and would appreciate any help.</p>
  
  <p>I tried adding the cssClass to both the text box and label but the formatting is off. </p>
  
  <p>Here is my css:</p>
  
  <pre><code>.form-control{
      margin-bottom:10px;
      width:300px;
      float:left;
  }
  
  .form-control-label{
      display:block;
      float:left;
  }
  </code></pre>
  
  <p>I added the css class in the script side using </p>
  
  <pre><code>label.CssClass = "form-control-label";
  textbox.CssClass = "form-control"
  </code></pre>
  
  <p>Here is the output and expected result<a href="https://i.stack.imgur.com/5Dv9H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Dv9H.png" alt="enter image description here"></a></p>