Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

get label and textbox to align vertically

How do I get the Label text and the Text Box to align vertically at their middles?

See screenshot

thx!
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddToCart.ascx.cs" Inherits="Spatz.controls.AddToCart" %>
 
<link rel="Stylesheet" href="../css/addtocart.css" type="text/css" />
 
<div id="addtocartdiv">
 
<div id="addtocarbgdiv">
<asp:Image ID="addtocartimage" runat="server" ImageUrl="~/img/addtocart_background.gif" />
</div>
 
<div id="quantitydiv">
<asp:Label ID="LabelQuantity" runat="server" Text="Quantity:"></asp:Label>&nbsp;&nbsp;&nbsp;
<asp:TextBox ID="TextBoxQuantity" runat="server" Width="35px"></asp:TextBox>
</div>
 
<div id="addtocartbuttondiv">
<asp:Image ID="addtocartbutton" runat="server" ImageUrl="~/img/addtocart_button.jpg" />
</div>
 
</div>

Open in new window

vertalign.jpg
Avatar of Tom Knowlton
Tom Knowlton
Flag of United States of America image

ASKER

addtocart.css file:
#addtocartdiv
{    
 
}
 
#addtocarbgdiv
{
    position:relative;
}
 
#quantitydiv
{
    vertical-align:top;
    position:absolute;
    width:120px;
    margin: 0 auto;
    top:20px;
    left:20px;
}
 
#addtocartbuttondiv
{
    position:absolute;
    top:50px;
    left:20px;
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thx