bootstrap创建textarea和两个内联按钮

时间:2016-03-29 18:17:06

标签: html5 css3 twitter-bootstrap-3

我需要使用bootstrap内联表单创建textarea和下面的按钮,或者在布局下面的任何其他方式,我尝试过下面的代码,但它似乎没有工作

<div class="form-inline">
                                <div class="form-group">
                                    <textarea class="form-control input-sm" rows="3" style="resize: none" ng-model="formData_EventDetails.serviceNowStr" id="serviceNowStr" readonly placeholder=""></textarea>
                                    <button class="uk-button primary " ng-click="viewServiceNowPopup(formData_EventDetails)" style="display: inline" > &nbsp;View &nbsp;</button>
                                    <button class="uk-button primary " ng-click="openServiceNowPopup(formData_EventDetails)" style="display: inline; margin-top: 5px" > Search </button>

                            </div>
                        </div>

enter image description here

2 个答案:

答案 0 :(得分:1)

使用bootstrap form horizo​​ntal来执行此操作

&#13;
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<div class="form-horizontal">
  <div class="form-group">
    <div class="col-xs-10">
      <textarea class="form-control input-sm" rows="3" style="resize: none" ng-model="formData_EventDetails.serviceNowStr" id="serviceNowStr" readonly placeholder=""></textarea>
    </div>
    <div class="col-xs-2">

      <button class="btn uk-button btn-block btn-default " ng-click="viewServiceNowPopup(formData_EventDetails)"> &nbsp;View &nbsp;</button>
      <button class="btn uk-button btn-block btn-primary " ng-click="openServiceNowPopup(formData_EventDetails)"> Search </button>

    </div>

  </div>
</div>
&#13;
&#13;
&#13;

请参阅here

答案 1 :(得分:0)

<div class="form-inline">
    <div class="form-group">
        <textarea class="form-control input-sm" rows="3" style="resize: none" ng- 
         model="formData_EventDetails.serviceNowStr" id="serviceNowStr" readonly 
         placeholder=""></textarea>
    </div>
   <div>
       <button class="uk-button primary " ng- 
       click="viewServiceNowPopup(formData_EventDetails)" style="display: inline" > 
       &nbsp;View &nbsp;</button>
       <button class="uk-button primary " ng- 
       click="openServiceNowPopup(formData_EventDetails)" style="display: inline; 
       margin-top: 5px" > Search </button>
   </div>