How to align both these elements in same line?

时间:2015-07-31 20:21:27

标签: css forms twitter-bootstrap twitter-bootstrap-3 angular-ui-bootstrap

I have a textarea and a submit button.

Before adding <form> element it looked like

enter image description here

Now, after surrounding those two elements with <form>, it changed to

enter image description here

<div class="input-group">
     <form>
       <input type="text" class="form-control" placeholder="Enter Message"/>
       <span class="input-group-btn" >   
         <button class="btn btn-info" type="submit">SEND</button>
       </span>
     </form>
</div>

How to get back the previous view with the <form> element included?

I am using angular-bootstrap-ui.

I have a custom.css file where I can override the default bootstrap CSS. I tried with ids for form and button, but didn't achieve the exact result. Any help please?

1 个答案:

答案 0 :(得分:2)

The input-group should be inside the form. Like so:

<form>
  <div class="input-group">
    <input type="text" class="form-control" placeholder="Enter Message">
    <span class="input-group-btn">   
      <button class="btn btn-info" type="submit">SEND</button>
    </span>
  </div>
</form>