I'm trying to set up a GUI website via Visual Web Developer 2010 Express for a user to enter information...
I'm using Labels and Text Boxes.
I'm having a problem setting them up to appear in the middle of the window but aligned properly. In a form, they are within a paragraph (
) and maybe that is the probem!
i.e., say the below is aligned in the center of a webpage, I want each label line to be centered left, and textbox line to be centered off of that (i.e., zip code since it is the longest string).
The lines represent where the textbox should begin...
Name: ___________
City: ___________
State: ___________
Zip Code: ___________
I can't seem to accomplish this!
I was trying to use Format --> Align --> Lefts, but it is greyed out, so I'm assuming it's not an option for an asp:label.
I also tried using Format --> Set Position --> Relative and manually moving it, but it is still not centering.
This is my code...
<p style="height: 173px" align="center" class="style2" Width="100%">
<asp:Label ID="LabelName" runat="server"
style="font-family: Arial; position: relative; top: 0px; left: 0px; color: #000066; font-weight: 700" Width="50px"
Text="Name:" ForeColor="#000066"></asp:Label>
<asp:TextBox ID="TextBoxName" runat="server"
style="color: #000066; font-family: Arial; position: relative; top: 0px; left: 51px;" Width="168px"
ontextchanged="TextBoxName_TextChanged" ForeColor="#000066"></asp:TextBox>
<br />
<asp:Label ID="LabelCity" runat="server"
style="font-family: Arial; position: relative; top: 2px; left: 0px; color: #000066; font-weight: 700" Width="50px"
Text="City:" ForeColor="#000066"></asp:Label>
<asp:TextBox ID="TextBoxCity" runat="server"
style="color: #000066; font-family: Arial; position: relative; top: 2px; left: 51px;" Width="168px"
ontextchanged="TextBoxCity_TextChanged" ForeColor="#000066"></asp:TextBox>
<br />
</p>
This might be trivial to some, but I'm new at this and would like any help!
Thanks,
Cindy