?
Solved

Display multiple labels and inputs on the same line

Posted on 2013-01-29
4
Medium Priority
?
1,293 Views
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:http://jarrattperkins.com/training/addtraining.aspx

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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
 <link href="Styles/jarratttraining.css" type="text/css" rel="stylesheet"/>
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
 <script src="js/JScript.js" type="text/javascript"></script>
    <title></title>
<style type="text/css">
label {
     display: inline-block;
     float:left;
}
</style>
        </head>
<body>

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

 <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:CalendarExtender> 
        <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender6" runat="server" 
            TargetControlID="rundatetime" 
            Mask="99/99/9999 99:99" 
            MessageValidatorTip="true" 
            OnFocusCssClass="MaskedEditFocus" 
            OnInvalidCssClass="MaskedEditError" 
            MaskType="DateTime" 
            AcceptAMPM="True" 
            ErrorTooltipEnabled="True" /> 
        <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator6" runat="server" 
            ControlExtender="MaskedEditExtender6" 
            ControlToValidate="rundatetime" 
            IsValidEmpty="False" 
            EmptyValueMessage="Date and time are required" 
            InvalidValueMessage="Date and/or time is invalid" 
            Display="Dynamic" 
            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>
    </asp:DropDownList>
    </div>
    <div>
    <label for="terrain1">Terrain Type:</label>
      <asp:DropDownList ID="terrain1" runat="server">
              <asp:ListItem>Road</asp:ListItem>
              <asp:ListItem>XC</asp:ListItem>
              <asp:ListItem>Track</asp:ListItem>
              <asp:ListItem>Other</asp:ListItem>
    </asp:DropDownList></div>
    <div>
       <label for="thedistance">Distance (Miles):</label>
    <asp:TextBox ID="thedistance" Width="30" runat="server"></asp:TextBox>
</div>
<div>
     <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;" />
    <div>
     <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>
            </select>
                       <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>
                  </div>
                   <div>
                 <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;" /> 
                      </div>
                       <div>
                           <label>Time-</label>
             
         <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>
                     </div>
                      <div>
                      <label for="weather1">Weather:</label>
                     <asp:DropDownList ID="weather1" runat="server">
                     <asp:ListItem>Sunny</asp:ListItem>
                      <asp:ListItem>Cloudy</asp:ListItem>
                       <asp:ListItem>Light Rain</asp:ListItem>
                        <asp:ListItem>Heavy Rain</asp:ListItem>
                         <asp:ListItem>Windy</asp:ListItem>
                          <asp:ListItem>Snow</asp:ListItem>
                     </asp:DropDownList>
                     </div>
                      <div>
                           <label for="comments">Comments:</label>
                     <asp:TextBox ID="comments" runat="server" Height="100px" Rows="10" 
                         Width="150px"></asp:TextBox>
                         </div>
                         <asp:Button CssClass="button" ID="Submit" runat="server" Text="Submit" />
        <asp:Button ID="Cancel" runat="server" Text="Cancel" />

	</fieldset>
    </div>

    </form>
</body>
</html>

Open in new window

0
Comment
Question by:runnerjp2005
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

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

label {
     display: inline-block;
     /*float:left;*/
}

Open in new window

0
 

Author Comment

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

http://jarrattperkins.com/training/addtraining.aspx
0
 
LVL 3

Expert Comment

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

Author Closing Comment

by:runnerjp2005
ID: 38830868
cleared cash and all ok
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

862 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