Display multiple labels and inputs on the same line

Posted on 2013-01-29
Last Modified: 2013-01-29
I am trying to display multiple label and inputs on the same line but the output seems to be

Label label input input

But it should be

Label input label input

The live site is here:

And here is html:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="addtraining.aspx.vb" Inherits="addtraining" %>
<%@ Register    Assembly="AjaxControlToolkit"    Namespace="AjaxControlToolkit"    TagPrefix="ajaxToolkit"%> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head id="Head1" runat="server">
 <link href="Styles/jarratttraining.css" type="text/css" rel="stylesheet"/>
 <script type="text/javascript" src=""></script>
 <script src="js/JScript.js" type="text/javascript"></script>
<style type="text/css">
label {
     display: inline-block;

    <form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server">
    <div id="addtrainingbox"> 

 <div><label for="rundatetime">Run Date And Time:</label>
 <asp:TextBox ID="rundatetime" runat="server" Width="180px" ValidationGroup="MKE" /> 
        <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" OnClientShown="onCalendarShown"  OnClientHidden ="onCalendarHidden" 
            Enabled="True" Format="dd/MM/yyyy HH:mm" TargetControlID="rundatetime"> 
        <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender6" runat="server" 
            Mask="99/99/9999 99:99" 
            ErrorTooltipEnabled="True" /> 
        <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator6" runat="server" 
            EmptyValueMessage="Date and time are required" 
            InvalidValueMessage="Date and/or time is invalid" 
            TooltipMessage="Input a date and time" 
            EmptyValueBlurredText="*Date and/or time is empty" 
            InvalidValueBlurredMessage="*Date and/or time is invalid" 
            ValidationGroup="MKE" /></div>

            <div><label for="Type">Training Type:</label>
		<asp:DropDownList ID="Type" runat="server">
              <asp:ListItem Value="SteadyRun">Steady Run</asp:ListItem>
              <asp:ListItem Value="EasyRun">Easy Run</asp:ListItem>
              <asp:ListItem Value="LongRun">Long Run</asp:ListItem>
              <asp:ListItem Value="Session">Session</asp:ListItem>
    <label for="terrain1">Terrain Type:</label>
      <asp:DropDownList ID="terrain1" runat="server">
       <label for="thedistance">Distance (Miles):</label>
    <asp:TextBox ID="thedistance" Width="30" runat="server"></asp:TextBox>
     <label for="repdistance1">Warmup:</label>
    <input name="repdistance1" type="text" id="Text1" style="width:30px;" />

     <label for="min1">Min:</label>
    <input name="min1" type="text" value="00" maxlength="2" id="min1" style="width:30px;" />
     <label for="sec1">Sec:</label>
    <input name="sec1" type="text" value="00" maxlength="2" id="sec1" style="width:30px;" />
     <label for="repdist1">Distance:</label>
     <input name="repdist1" type="text" id="repsit1" style="width:30px;" />
     <select name="kmormile1" id="kmormile1">
     	<option value="Miles">Miles</option>
        	<option value="Km">Km</option>
                       <label for="repmin1">Min:</label>
                     <input name="repmin1" type="text" value="00" maxlength="2" id="repmin1" style="width:30px;" />
                       <label for="repsec1">Sec:</label>
                     <input name="repsec1" type="text" value="00" maxlength="2" id="repsec1" style="width:30px;" /><a href="#" id="addButton" class="addButton">Add</a><a href="#" id="removeButton" class="removeButton">Remove</a>
                 <label for="cooldistance">Cooldown:</label>
                       <input name="cooldistance" type="text" id="TextBox1" style="width:30px;" />
                      <label for="coolmin1">Min:</label>
                     <input name="coolmin1" type="text" value="00" maxlength="2" id="coolmin1" style="width:30px;" />
                    <label for="coolsec1">Sec:</label>
                     <input name="coolsec1" type="text" value="00" maxlength="2" id="coolsec1" style="width:30px;" /> 
         <label for="thr">Hr:</label>
                     <asp:TextBox ID="thr" Text="00" Width="30" MaxLength="2" runat="server"></asp:TextBox>
                        <label for="tmin">Min:</label>
                     <asp:TextBox ID="tmin" Text="00" Width="30" MaxLength="2" runat="server"></asp:TextBox>
                            <label for="tsec">Sec:</label>
                     <asp:TextBox ID="tsec" Text="00" Width="30" MaxLength="2" runat="server"></asp:TextBox>
                      <label for="weather1">Weather:</label>
                     <asp:DropDownList ID="weather1" runat="server">
                       <asp:ListItem>Light Rain</asp:ListItem>
                        <asp:ListItem>Heavy Rain</asp:ListItem>
                           <label for="comments">Comments:</label>
                     <asp:TextBox ID="comments" runat="server" Height="100px" Rows="10" 
                         <asp:Button CssClass="button" ID="Submit" runat="server" Text="Submit" />
        <asp:Button ID="Cancel" runat="server" Text="Cancel" />



Open in new window

Question by:runnerjp2005
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Accepted Solution

Khilu earned 500 total points
ID: 38830812
Remove float:left form label css class from addtraining.aspx and jarratttraining.css

label {
     display: inline-block;

Open in new window


Author Comment

ID: 38830833
I did the above and still shows the same

Expert Comment

ID: 38830851
You have removed it from addtraining.aspx file only.
You also have to remove "float:left" from jarratttraining.css file

Author Closing Comment

ID: 38830868
cleared cash and all ok

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Link Anchor Not working 9 65
Read text on Table 7 44
CSS overflow problem 21 36
css messed up 8 23
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question