解法:

在最外面的div中加上form-inline class即可!!

--

轉自 https://www.cnblogs.com/initx/p/11509959.html--

form-control 總是會換行,後面加單位的時候很難看,如下圖。

複製代碼
1  < div class ="col-sm-3" >  
2       <輸入id ="investAmount" name ="investAmount" class ="form-control"必需 th:field ="*{investAmount}" type ="text" > 
3      <選擇名稱="unit"="form-control" th:field ="*{unit}" id ="unit"  > 
4            < option value ="萬元" >萬元</ option > 
5        < option value="億元" >億元</ option > 
6     </ select >     
7   </ div >
複製代碼

 

 

嘗試了多種方法,終於發現在外框裡加入form-inline就可完美解決。

複製代碼
1 < div class =" form-inline col-sm-3" >  
2       <輸入id ="investAmount" name ="investAmount" class ="form-control"必需 th:field ="*{investAmount}" type ="文本” > 
3      <選擇名稱="unit"="form-control" th:field ="*{unit}" id ="unit"  > 
4            < option value ="萬元" >萬元</ option >
5        < option value ="億元" >億元</ option > 
6     </ select >     
7   </ div >
複製代碼

 

--

arrow
arrow
    文章標籤
    HTML
    全站熱搜

    dizzy03 發表在 痞客邦 留言(0) 人氣()