Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

how can i get the label an input text field to lay side by side

 <div class="contains_1">

    <h3 class="sub_title" id="con_info">Contact Information</h3>

  <label class="lab" id="full">Full Name</label>
 <input type="text" id="fullname" name="Full Name" placeholder="required" required="required">

    <label class="lab" id="mail">Email Address</label>
 <input type="text" id="email" name="Email Address" placeholder="required" required="required">

   <label class="lab" id="wire">Phone</label>
   <input type="text" id="phone" name="Phone Number" placeholder="absolutely" required="required">

    <fieldset id="mailfield">
   <legend>Mailing Info</legend>
   <label class="lab">Street Address</label>
   <input type="text" id="address" name="Street Address" placeholder="optional" required="required" class="data">

   <label class="lab">City</label>
   <input type="text" id="city" name="City" placeholder="optional" required="required" class="data">


   <select name="states">
   <option value="choose state">Choose State</option>
   <option value="new york">New York</option>
   <option value="new jersey">New Jersey</option>
   </select>  


    <label class="zip">Zip Code</label>
    <input type="text" id="zip" name="Zipcode" placeholder="optional" required="required"> 
     </fieldset>
    </div>

     ```html

2 Answers

alastair cooper
alastair cooper
30,617 Points

Make sure that your labels ( in this case .lab ) and your inputs are both still set to display:inline (or display:inline-block) (they are by default) and that your container div (contains_1) is wide enough to hold them side by side.

That should sort it. If not, sorry, I don't know. Only just starting myself.

thanks but I figured it out , I don't know what I was thinking . there was something wrong with how I was selecting the elements.. I did more than what I really had to do hahahahah ... I know you along with other programmers have done the same... Anyway happy codings!