1

this is sample code

<section class="col-md-12"> 
  <div class="col-xs-6 col-xs-offset-3 col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3 pull-right">
    <button ><a href="" class=" text-center">Test Btn</a></button>
  </div>
</section>

Is there way to set vertical aligment to middle for button for all screens ? I currently do that with margin-top in media queries, but it is "too much" coding, and just to ask for any simpler ideas ?

Tnx, P

pavlenko
  • 625
  • 2
  • 11
  • 30

2 Answers2

3

.align-self-center will work.

eg

<section class="col-md-12 align-self-center"> 
</section>
George
  • 2,842
  • 2
  • 15
  • 11
2

Is this the solution you want?

http://output.jsbin.com/solomikebe

Essentially, this is the code

.parent {
  height: 200px;
  background-color: red;
  display: flex;
  flex-direction: row;
  align-items: center;
}

where the container div has parent class.

Bikas
  • 2,709
  • 14
  • 32