C# 如何在C语言中对齐标签和文本框#

C# 如何在C语言中对齐标签和文本框#,c#,css,asp.net,C#,Css,Asp.net,我需要设置aspx文件的样式 它有标签和文本框,但对齐方式不正确 实际上我需要标签和文本框以适当的间距并排对齐 <div class="col-md-12"> <p> <asp:Label ID="Label1" runat="server" Text="Your Name : "></asp:Label> <asp:TextBox ID=

我需要设置aspx文件的样式

它有标签和文本框,但对齐方式不正确

实际上我需要标签和文本框以适当的间距并排对齐

        <div class="col-md-12">
            <p>
                <asp:Label ID="Label1" runat="server" Text="Your Name : "></asp:Label>
                <asp:TextBox ID="name" runat="server"></asp:TextBox>
            </p>
            <p>
                <asp:Label ID="Label2" runat="server" Text="Your Email ID : "></asp:Label>
                <asp:TextBox ID="email" runat="server"></asp:TextBox>
            </p>
            <p>
                <asp:Label ID="Label3" runat="server" Text="Your Contact Number: "></asp:Label>
                <asp:TextBox ID="mob" runat="server"></asp:TextBox>
            </p>
            <p>
                <asp:Label ID="Label4" runat="server" Text="Select your subject : "></asp:Label>
                <asp:TextBox ID="subject" runat="server"></asp:TextBox>
            </p>
            <p>
                <asp:Label ID="label5" runat="server" Text="Your Message : "></asp:Label>
                <asp:TextBox ID="message" runat="server" TextMode="MultiLine"></asp:TextBox>
            </p>
            <p>
                <asp:Button ID="submitButton" runat="server" Text="Submit" />
                <asp:Button ID="resetButton" runat="server" Text="Reset" />
            </p>
        </div>




是否有无表使用的选项??使用CSS对齐这些元素是可能的,而且非常简单。这个问题已经被回答了上百次,所以如果你下定决心不使用表格,谷歌会给出很多结果。在本例中,我建议使用表。在这里使用表格并没有坏处,它将完全完成您希望完成的任务,并且不会花费您超过五分钟的时间。
<asp:TableRow>
<asp:TableCell Width="100px" Height="35px"><asp:Label></asp:Label></asp:TableCell>
<asp:TableCell><asp:TextBox></asp:TextBox></asp:TableCell>
</asp:TableRow>