2016-08-04 116 views
0

嗨,我很新的HTML,CSS,JavaScript和jquerymobile。我有一個問題可能看起來很簡單,但我無法弄清楚。排列有多行元素

注:即時通訊使用一個網站名爲https://ezoui.com/app/index.html這個項目。

我想創建一個formular(基於html/jquerymobile),用戶可以插入不同的值現在出現我的問題。我希望這些元素中的一部分與此類似。

[標籤] [TEXTAREA /輸入] _______whitespace_______________ [標籤] [TEXTAREA /輸入]

[標籤] [TEXTAREA /輸入] _______whitespace_______________ [標籤] [TEXTAREA /輸入]

[標籤] [ textArea/input]

我只能設法讓一個標籤和一個textarea排成一行而不是多個。

任何建議和例子表示讚賞。

回答

0

p { 
 
    float: left; 
 
    margin-right: 15px !important; 
 
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> 
 

 

 

 
<div class="row"> 
 
    <div class="col-xs-6"> 
 
    <p>some Label</p> 
 
    <input type="text"> 
 
    </div> 
 
    <div class="col-xs-6"> 
 
    <p>some other Label</p> 
 
    <input type="text"> 
 
    </div> 
 
</div> 
 
<div class="row"> 
 
    <div class="col-xs-6"> 
 
    <p>sweg</p> 
 
    <input type="text"> 
 
    </div> 
 
    <div class="col-xs-6"> 
 
    <p>another</p> 
 
    <input type="text"> 
 
    </div> 
 
</div>

+0

是差不多了,剩下的唯一的事情是,標籤應該是旁邊的文本區域,而不是在它上面。這也是我的問題所在。 – TheWandererr

+0

你走了......更新了答案。 注:我使用引導網格系統,它使這樣的事情更容易。看看它,學習和使用非常方便。 http://getbootstrap.com/css/#grid – sandrooco

+0

非常感謝 – TheWandererr