简体   繁体   中英

How to align Label and TextBox in C#

I need to style the aspx file.

Which has Label and TextBox, but alignment for not proper.

Actually I need Lable and TextBox to be aligned side-by side with proper spacing.

        <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>
<asp:TableRow>
<asp:TableCell Width="100px" Height="35px"><asp:Label></asp:Label></asp:TableCell>
<asp:TableCell><asp:TextBox></asp:TextBox></asp:TableCell>
</asp:TableRow>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM