How to use vertical align in bootstrap

后端 未结 8 2174
北恋
北恋 2020-11-29 22:29

Simple problem: How do I vertically align a col within a col using bootstrap? Example here (I want to vertically align child1a and child1b):

http://bootply.com/7366

8条回答
  •  无人及你
    2020-11-29 23:00

    For the parent: display: table;

    For the child: display: table-cell;

    Then add vertical-align: middle;

    I can make a fiddle but home time now, yay!

    OK here is the lovely fiddle: http://jsfiddle.net/lharby/AJAhR/

    .parent {
       display:table;
    }
    
    .child {
       display:table-cell;
       vertical-align:middle;
       text-align:center;
    }
    

提交回复
热议问题