Formatting issues with text boxes and labels causing misalignment

My labels and text boxes are not aligning properly, despite my efforts.

Even though this is what I want:

Here is the CSS:

.dropDownList 
{
float:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:206px;
margin:2px 0 20px 10px;
}

.descriptionBox 
{

font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:47em;
height:100px;
margin:2px 0 20px 10px;
}
.center 
{
text-align:center;
padding:100px;
}

p, h1, form, button{border:0; margin:0; padding:0;}
.spacer{clear:both; height:1px;}
/* ----------- My Form ----------- */
.myform{
margin:0 auto;
width:50em;
padding:14px;
}

#stylized{
border:solid 2px #7fc041;
background:#FDE16D;
}
#stylized h1 {
font-size:14px;
font-weight:bold;
margin-bottom:8px;
}
#stylized p{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #7fc041;
padding-bottom:10px;
}
#stylized label{
display:block;
font-weight:bold;
text-align:right;
width:140px;
float:left;
}
#stylized .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:right;
width:140px;
}
#stylized input{
float:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}

And the ASP server controls/HTML:

<div id="stylized" class="myform">
        <form id="form" name="form" method="post">
        <h1>
            Non-Scrum Stories</h1>
        <p>
            <asp:RadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"
                AutoPostBack="true" RepeatDirection="Horizontal">
                <asp:ListItem Selected="True">Add New</asp:ListItem>
                <asp:ListItem>Update or Delete</asp:ListItem>
            </asp:RadioButtonList>
        </p>
        <asp:Panel ID="newPanel" runat="server" Visible="true">

            <label>
                <asp:Label ID="Label7" runat="server" Text="Catagory:"></asp:Label>
            </label>
            <asp:DropDownList ID="catagoryDropDown" runat="server" DataSourceID="SqlDataSource3"
                DataTextField="Catagory" DataValueField="PK_SupportCatagory" CssClass="dropDownList">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                SelectCommand="SELECT [PK_SupportCatagory], [Catagory] FROM [SupportCatagory]">
            </asp:SqlDataSource>
                        <label>
                <asp:Label ID="label5" runat="server" Text="Date Completed:"></asp:Label>
            </label>
            <BDP:BasicDatePicker ID="dateInput" runat="server">
            </BDP:BasicDatePicker>
            <label>
                <asp:Label ID="Label2" runat="server" Text="Application:" CssClass="leftFloat"></asp:Label>
            </label>
            <asp:DropDownList ID="applicationDropDown" runat="server" DataSourceID="SqlDataSource2"
                DataTextField="AppName" DataValueField="PK_Application" CssClass="dropDownList" >
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                SelectCommand="SELECT [PK_Application], [AppName] FROM [Application]"></asp:SqlDataSource>
            <label>
            <asp:Label ID="Label3" runat="server" Text="Incident #:"></asp:Label>
            </label>
            <asp:TextBox ID="incidentInput" runat="server"></asp:TextBox>
 <label>
   <asp:Label ID="Label6" runat="server" Text="Hours:"></asp:Label>
 </label>
 <asp:TextBox ID="hoursInput" runat="server"></asp:TextBox>
 <label><asp:Label ID="Label4" runat="server" Text="Description: "></asp:Label></label>

    <asp:TextBox ID="descriptionInput" runat="server" Rows="10" TextMode="multiline" CssClass="descriptionBox"></asp:TextBox>

            <button type="submit">
                Sign-up</button>
            <div class="spacer">
            </div>
        </form>
    </div>
    </asp:Panel>

I'm struggling to achieve the desired layout. What should I do?

Answer №1

For precise alignment, consider utilizing HTML tables for structuring the design.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unique design and elements featuring the `width: auto` property for custom fonts

In my current project, I am utilizing the popular 'Open Sans' font family. However, I am encountering a specific issue. The problem arises with buttons and other elements that have width: auto. Upon page load, these elements initially have their ...

Rails encounters problems when assets are modified

I recently inherited a small Rails website. When I attempted to make a change to a css file, I encountered an error page (code 500) in Rails with the following message: No such file or directory - /.../cache/assets/sprockets%2F1450c8f5d2b6e201d72fa175586b ...

Tips for activating sorting on a GridViewCommandColumn in a DevExpress ASPxGridView

All columns except the command column are sortable within the grid. However, the command column does not trigger a callback to sort the grid itself. I am looking to enable sorting for GridViewCommandColumn so that I can implement a customized column sort ...

Is there a way to handle the ajax request only when necessary, instead of processing it every few seconds?

Currently, I am working on an AJAX chat system using PHP, MySQL, JavaScript, and AJAX. I have a piece of code that retrieves all chat messages within a div using AJAX, with the function running every 2 seconds. My issue lies in the fact that the div autom ...

utilizing web functionalities alongside master page layouts

I have a universal function implemented across all pages of my website, residing in the master page. I am aiming to trigger this function through a jQuery Ajax method. Currently, my code looks something like this: jQuery $(document).ready(function() { ...

Utilizing Jquery for toggling HTML elements and styling with CSS

I'm trying to implement a jQuery toggle button that switches between two states below; When I click the Toggle Button/link, everything in picture A (above the red line) should be hidden. Clicking the toggle button again would make it reappear. I&apo ...

Locate linked text and the accompanying web address

If I have a lengthy text where some words are hyperlinked, how can I extract all the text and their corresponding hyperlink URLs? For example, take this text: LoremIpsum.Net is a convenient tool that provides users with a block of text without needing to ...

Tips for repositioning a child div to the top upon detecting a text change

I am working with a parent div that contains 3 child divs. I am curious if there is a way to automatically move a child div to the top if any changes are made to its text or link? <div id="latest"> <div class="post post-1"><a href="#"> ...

The issue of content not appearing on the screen when using the load() function in jQuery

Having some trouble with my html/php code. When I click on any of the tab links, the content from the file doesn't load into the designated <div>. PHP code : <!DOCTYPE html> <html> <head> <style type="text/css"> ul.t ...

What is the best way to clear an XML or table?

As I delve into learning Javascript, I've been experimenting with different approaches to achieve a specific functionality. I'm trying to implement a button that can toggle or hide XML data in a table. My attempts so far have involved adding anot ...

Unable to view flash elements in HTML using Django framework

Apologies for any errors in my English, I will do my best to explain clearly. I am new to working with Django and I have a html page with flash content called map.html. I would like to include this page into another page called soporte.html (which extends ...

Ways to align an element within its parent element without relying on absolute positioning

I'm in the process of creating a basic header for my website, and I'm looking to place my back button inside a div container with it floating to the left. However, I also want the "Header" text to be centered within the parent div. I initially ...

Eliminate the CSS styling applied to a select element using jQuery

I'm facing an issue where I have multiple CSS styles applied to an input field - one default and others for customization. I want to disable the default CSS without affecting the custom ones. I attempted to remove it using: $j('#teste').css ...

What are alternative ways to incorporate React Router JS in ReactJS without relying on Webpack?

Recently, I've started working with reactjs and facing difficulties in implementing route changes. Are there any straightforward solutions available for handling router change events without using webpack? var PageOne = React.createClass({ render: ...

Show the contents directly within the Bootstrap table

I'm currently facing an issue with displaying monetary value information in a Bootstrap 4 table in responsive mode. Here's a breakdown of my problem: Here is the HTML code snippet I am using: <div class="table-responsive"> <table clas ...

Mobile Size Setting

Could someone please explain to me why when I test this code on Google Chrome using the mobile emulator for Galaxy S3, it displays the correct size (640x360), but when I try to load it on my actual Galaxy S5 or any other device, the size is different from ...

Selecting a specific value in a row from an HTML table - a comprehensive guide

This is a similar structure where, if I check the first button, I can retrieve the January month savings stored in a text field. Hello everyone, I am looking to design a table that includes a checkbox in the first column of each row. Upon selecting this ...

Building a custom form layout using Bootstrap v4 with three input fields and a button all lined up on one

I am struggling to create a form with 3 input fields and a button on the same row using Bootstrap v4 for the design. Can anyone help me figure this out? Take a look at my current design: Click here My Code <div class="col-sm-7 mx-auto bg-faded"&g ...

Error in CSS styling affecting image display on responsive website

My CSS seems to have a bug when it comes to responsive pages with images. Take a look at the demo: https://jsfiddle.net/xr4getom/ If you resize the window on this example, you'll notice that a dark background (#222) appears intermittently. Is there ...

What is the process for updating a particular div element?

I am currently developing a webpage that allows users to select an item, and the relevant information will be displayed. On this page, I have incorporated two buttons: btnBuy0 and btnBuy1. The functionality I am aiming for is that when BtnBuy0 is clicked ...