charlie_cat
charlie_cat

Reputation: 1850

label and input tag width controlled by css

i had a look at some examples here and followed one, but it is not wokting. what am i missing please?

  fieldset {
  overflow:hidden;
  width:90%
 }
 label {
   padding-left:26px;
   width:250px; 
   display:block; float:left; clear:left;
 }

 input { 
  width:200px;
  display:block; float:left;
 }

 .formFieldDiv { float:left; width:500px }


 <td style="width:70%" align="left" valign="top">   
 <form id="divorce" name="divorce" method="post" action="send_form_email.php">
     <fieldset>
        <div id="spouse1" class="formFieldDiv" >
          <label for="spouse1">Full Names + Surname Spouse 1*</label>
          <input type="text" name="spouse1" id="spouse1" maxlength="50" size="30" />                           
        </div>
        <div id="spouse2" class="formFieldDiv">
          <label for="spouse2">Full Names</label>                       
            <input  type="text" name="spouse2" id="spouse2" maxlength="50" size="30"/> 
        </div>
     </fieldset>
 </form>
 </td>

what am i missing? I want to get the input's all in line

on the actual page

Upvotes: 1

Views: 51

Answers (3)

Ankit K
Ankit K

Reputation: 1326

 formFieldDiv is a class so use . before it in css ie- 
.formFieldDiv { float:left; width:500px } instead of
formFieldDiv { float:left; width:500px }

Upvotes: 2

user2846400
user2846400

Reputation:

<div id="spouse1" class="formFieldDiv" >
       <label for="spouse1">address</label>                
       <input type="text" name="spouse1" id="address" maxlength="50" size="30" />                          
     </div>>

change </div>> to </div>

And i need to look your send_form_email.php file

Upvotes: 1

razemauze
razemauze

Reputation: 2676

Add

display:inline-block;

to your label

Upvotes: 1

Related Questions