Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8490237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:03:41+00:00 2026-06-10T22:03:41+00:00

Sorry for asking something basic here but I have not been able to apply

  • 0

Sorry for asking something basic here but I have not been able to apply right approach in formatting controls.

Below is a part of the code in ASPX page. I am failing in formatting it properly. I need some help here about what to consider and how to do it. Below is what the output looks like.

enter image description here

I would like the textbox (or dropdown) to align to it’s label correctly. I know I haven’t used stylesheet here but wanted to know if I can achieve without stylesheet. Even if stylesheet is required to achieve format, please suggest what to consider and how to proceed.

What is in ASPX page is below,

<div runat="server" id="DivCCInfo">
<fieldset class="CreditCardInformation">
    <legend>
        <asp:Literal runat="server" ID="CCHeaderLabel" Text= "Credit Card Information" />
    </legend>
    <div>
        <asp:Label ID="CreditCardHolderLabel" runat="server" AssociatedControlID="CreditCardHolder" Text="Cardholder's Name" />
        <br />
        <asp:TextBox ID="CreditCardHolder" runat="server" CssClass="TextBox" MaxLength="30" Width="300" style ="left:-100px" ></asp:TextBox>
        <asp:Label ID="CreditCardTypeLabel" runat="server" AssociatedControlID="CreditCardType" Text="Credit Card Type" />
        <asp:Label ID="CreditCardNumberLabel" runat="server" AssociatedControlID="CreditCardNumber" Text="Credit Card Number" />
        <asp:Label ID="ExpirationLabel" runat="server" AssociatedControlID="ExpirationMonth" Text="Expiration Date"  />
        <asp:Label ID="CVVLabel" runat="server" AssociatedControlID="CVV" Text="CVV Code" />
        <br /><br />
        <asp:DropDownList runat="server" ID="CreditCardType"  Width="105">
            <asp:ListItem Text="VISA"  Value="VISA" />
            <asp:ListItem Text="MasterCard" Value="MasterCard" />
            <asp:ListItem Text="Discover" Value="Discover" />
            <asp:ListItem Text="Amex" Value="Amex" />
        </asp:DropDownList>
        <asp:TextBox ID="CreditCardNumber" runat="server" CssClass="TextBox" MaxLength="16" Width="120"></asp:TextBox>
        <asp:DropDownList runat="server" ID="ExpirationMonth" Width="40">
            <asp:ListItem Text="01" Value="01" />
            <asp:ListItem Text="02" Value="02" />
        </asp:DropDownList>
        <asp:DropDownList runat="server" ID="ExpirationYear" Width="60">
            <asp:ListItem Text="2012" Value="2012" />
            <asp:ListItem Text="2013" Value="2013" />
        </asp:DropDownList>

        <asp:TextBox ID="CVV" runat="server" CssClass="TextBox"   MaxLength="4" Width="50"></asp:TextBox>
    </div>
</fieldset>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:03:42+00:00Added an answer on June 10, 2026 at 10:03 pm

    I can see a fast way of doing this using <table> HTML element:

    Something like this:

    <table>
        <tr>
            <td>
                <asp:Label
                     ID="CreditCardTypeLabel"
                     runat="server"
                     AssociatedControlID="CreditCardType"
                     Text="Credit Card Type" />
            </td>
            <td>
                <asp:Label
                     ID="CreditCardNumberLabel"
                     runat="server"
                     AssociatedControlID="CreditCardNumber"
                     Text="Credit Card Number" />
            </td>
            <td>
                <asp:Label
                     ID="ExpirationLabel"
                     runat="server"
                     AssociatedControlID="ExpirationMonth"
                     Text="Expiration Date"  />
            </td>
            <td>
                <asp:Label
                     ID="CVVLabel"
                     runat="server"
                     AssociatedControlID="CVV"
                     Text="CVV Code" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:DropDownList
                     runat="server"
                     ID="CreditCardType"
                     Width="105">
                     <asp:ListItem
                          Text="VISA"
                          Value="VISA" />
                     <asp:ListItem 
                          Text="MasterCard"
                          Value="MasterCard" />
                     <asp:ListItem
                          Text="Discover"
                          Value="Discover" />
                     <asp:ListItem
                          Text="Amex"
                          Value="Amex" />
                 </asp:DropDownList>
            </td>
            <td>
                <asp:TextBox
                     ID="CreditCardNumber"
                     runat="server"
                     CssClass="TextBox"
                     MaxLength="16"
                     Width="120">
                 </asp:TextBox>
            </td>
            <td>
                <asp:DropDownList
                     runat="server"
                     ID="ExpirationMonth"
                     Width="40">
                     <asp:ListItem
                          Text="01"
                          Value="01" />
                     <asp:ListItem
                          Text="02"
                          Value="02" />
                 </asp:DropDownList>
                 <asp:DropDownList runat="server" ID="ExpirationYear" Width="60">
                      <asp:ListItem Text="2012" Value="2012" />
                      <asp:ListItem Text="2013" Value="2013" />
                 </asp:DropDownList>
            </td>
            <td>
                <asp:TextBox
                     ID="CVV"
                     runat="server"
                     CssClass="TextBox"
                     MaxLength="4"
                     Width="50">
                 </asp:TextBox>
            </td>
        </tr>
    </table>
    

    Just place your controls inside the table elements and they’ll align perfectly allowing you to even left/center/right align them if you desire.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for asking a totally basic question, but if I have a synthesized property
I am sorry if I am asking something that has been answered already but
Sorry if im asking something stupid but please dont shoot me down! I have
I am sorry if I am asking something stupid but I am completely a
Sorry for asking a question about something I don't know much about, but I've
Sorry for may be not clear question, but I'm asking it, because I don't
Sorry for asking such a basic question but so far all the examples that
Sorry for asking something that is widely documented, but I came across so many
I'm sorry if I'm asking something too specific, but I'm a beginner in PHP
Sorry for asking probably a basic question, but I'm having a blackout. If I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.