4

In the following code:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="container">
    <div class="row">
 <div class="col-lg-12">
  <div class="panel panel-primary">
   <div class="panel-heading"><h2>Element Selection</h2></div>
   <div class="panel-body">
    <div class="row">
     <div class="col-lg-5">
      <div class="form-group">
       <h3><span class="label label-info">Element Segment</span></h3>
       <textarea class="form-control" rows="8"></textarea>
      </div>
     </div>
     <div class="col-lg-2 text-center" >
      
      <div class="btn-group-vertical">
       <button type="button" class="btn btn-primary">>></button>
       <button type="button" class="btn btn-primary"><<</button>
       <button type="button" class="btn btn-primary">ALL>></button>
       <button type="button" class="btn btn-primary"><< ALL</button>
      </div>
      
     </div>
     <div class="col-lg-5">
      <div class="form-group">
       <h3><span class="label label-success">Element Segment</span></h3>
       <textarea class="form-control" rows="8"></textarea>
      </div>
     </div>
    </div>
   </div>
  </div>
 </div>

</div>
</div>

now the result is below: enter image description here

so I can I put the button group in the center position vertically. I searched and tried vertical-align: middle, but it didn't work for me.

Sebastien Daniel
  • 4,649
  • 3
  • 19
  • 34
Chris Bao
  • 2,418
  • 8
  • 35
  • 62
  • 1
    Check here: http://stackoverflow.com/questions/20547819/vertical-align-with-bootstrap-3 – vaso123 May 06 '16 at 13:18
  • if you are able to give that row an id, I would do something like this: http://www.bootply.com/87KkKmPmqK – Pete May 06 '16 at 13:24

2 Answers2

1

You can use Flexbox with media queries DEMO (1200px is for .col-lg-)

@media(min-width: 1200px) {
  .flex-row {
    display: flex;
    align-items: center;
  }
}
Nenad Vracar
  • 118,580
  • 15
  • 151
  • 176
1

Answer already posted by @Nenad Vracar, but you can also try this

 .flex-row {
    display: flex;
    align-items: center;
  }

DEMO HERE

Ivin Raj
  • 3,448
  • 2
  • 28
  • 65