title: Aligning ASP.Net Labels and TextBoxes using CSS?
body: <p>I need to use CSS to line up my ASP.NET labels and textboxes.  I've tried using DIVs with styling per below, but things still aren't lining up.  </p>
  
  <pre><code>&lt;div style="float:left; display:block;"&gt;
  &lt;asp:Label runat="server" id="lblPartNumber" CssClass="label"&gt;Part Number:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblSubID" CssClass="label"&gt;Sub ID:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblPartDesc" CssClass="label"&gt;Part Description:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblForModels" CssClass="label"&gt;For Models:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblColor" CssClass="label"&gt;Color:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblPrice" CssClass="label"&gt;Price:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblMisc" CssClass="label"&gt;Misc:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" id="lblLiveImage" CssClass="label"&gt;Live Image:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblOEMNumber" CssClass="label"&gt;OEM Number:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblBEDiscount" CssClass="label"&gt;BE Discount:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Label runat="server" ID="lblSalePrice" CssClass="label"&gt;Sale Price:&lt;/asp:Label&gt;&lt;br /&gt;
  &lt;asp:Button runat="server" ID="btnAddPart" Text="Add Part" /&gt;
  &lt;/div&gt;
  &lt;div style="display:block; padding-left:20px;"&gt;
  &lt;asp:TextBox runat="server" ID="txtPartNumber" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtSubID" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtPartDesc" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtForModels" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtColor" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtPrice" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtMisc" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtLiveImage" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtOEMNumber" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtBEDiscount" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;asp:TextBox runat="server" ID="txtSalePrice" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;/div&gt;    
  </code></pre>
  
  <p>What additional CSS syntax must be added to ensure all my labels are lined up under each other, and their corresponding textbox is beside it?</p>
  
  <p>Thanks!</p>