javascript - How to display inline "input" elements, surrounded by divs -


i have html code, 3 input fields :

       <div class="field" >           <input placeholder="firstname" class="firstname" id="firstname_field"  name="firstname" size="30" value="" type="text" >        </div>        <div class="field" >            <input placeholder="lastname" class="lastname" id="lastname_field"  name="lastname" size="30" value="" type="text" >        </div>        <div class="field" >            <input placeholder="email" class="email" id="email_field"  name="email" size="30" value="" type="text" >        </div> 

currently, because surrounded div's, display in block : http://jsfiddle.net/k2nqp/159/ need 2 first fields display "inline" , not block, , 3rd 1 stay block.

easy if put "display:inline-block" inside div's. tricky part here, don't have control on html code, it's auto-generated shortcode. can add css, using existing classes, or javascript (i used javascript insert placeholder)

and since 3 divs have same class, display block or inline, can work on input fields. unfortunately tried specified "inline-block" input fields, , it's not working.

any idea on how make work ? thank !

use below css, achieve expected result

.field{  display:inline;  } #email_field{   display:block; } 

http://jsfiddle.net/nagasai_aytha/k2nqp/164/

display:inline allow fields displayed in inline , display:block on third field , make block element , gets displayed in separate line


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -