简体   繁体   中英

How to set input text be shown inline with css?

I try to make inputs be displayed one after another in line using float: right.

[input][input][input]

But instead of it i see steps:

[input]
       [input]
               [input] 

Do anyone has any suggestions? I use labels in form as following

here is my code:

כותרת נוספת
  <label for="pa_passport">מספר ת.ז</label> <input type="text" name="pa_passport" id="pa_passport" placeholder="מספר ת.ז" /><br /> <label for="pa_firstName">שם פרטי</label> <input type="text" name="pa_firstName" id="pa_firstName" placeholder="שם פרטי" /><br /> <label for="pa_lastName">שם משפחה</label> <input type="text" name="pa_lastName" id="pa_lastName" placeholder="שם משפחה" /><br /> <div style="clear:both"> </div> <label for="pa_city">עיר מגורים</label> <input type="text" name="pa_city" id="pa_city" placeholder="עיר מגורים" /><br /> <label for="pa_car">מספר רכב</label> <input type="text" name="pa_car" id="pa_car" placeholder="מספר רכב" /><br /> <label for="pa_city">שנת ייצור</label> <input type="text" name="pa_year" id="pa_year" placeholder="שנת ייצור" /><br /> <h4 class="faqlike bluecolh2">כותרת נוספת</h4> <label for="pa_phone">טלפון</label> <input type="text" name="pa_phone" id="pa_phone" placeholder="טלפון" /><br /> <label for="pa_phone"></label> <select> <option>054</option> <option>052</option> <option>053</option> <option>050</option> <option>08</option> <option>09</option> </select> 

===UPDATE=====

Here is my scss:

 .private_area { label { display:none; } input[type=text] { float: right; } } 

I think this is what you want right?

body { direction:rtl;}
H4    { clear:both; padding:20px 0;}
label { display:inline-block; width: 70px; margin:0 5px 0 0;}
.field { float:right;}

DEMO

let me know if you have any questions :) בהצלחה

我认为问题在于每次输入后都有break语句。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM