html - Centre an Icon within a div - Bootstrap 3 & Font Awesome -


i have simple bootstrap grid row displaying text in 1 column , stacked font-awesome icon set in column. issue i'm having icon-set not vertically aligned in middle of div, text is. can see icon more aligned top of div. there way center align this?

i've created fiddle here , re-posted code below:

html:

<div class="container-fluid">   <div class="row posted-content">     <div class="col-md-10">       <h4 class="text-primary pull-left">hey, text</h4>     </div>     <div class="col-md-2 comment-count pull-right">       <a class="fa-stack comment-action">         <i class="fa fa-comment-o fa-fw fa-stack-2x"></i>         <i class="fa fa-stack-1x">5</i>       </a>     </div>   </div> </div> 

css:

.posted-content {   border-radius: 4px;   border-color: #e7e7e7;   border: 1px solid rgba(0, 0, 0, 0.1);   max-width: 1140px;   background-color: #f8f8f8;   margin-bottom: 0px;   vertical-align: middle; } 

i've tried playing vertical-align no avail. ideas appreciated.

try this

<div class="container-fluid">   <div class="row posted-content centered-vertically">     <div class="col-md-10">       <h4 class="text-primary pull-left">hey, text ghssd fjkflsdj sdfkkl;asdk</h4>     </div>     <div class="col-md-2 comment-count pull-right">       <a class="fa-stack comment-action">         <i class="fa fa-comment-o fa-fw fa-stack-2x"></i>         <i class="fa fa-stack-1x">5</i>       </a>     </div>   </div> </div> 

css

.container-fluid .centered-vertically{   display:flex;   align-items:center; } 

fiddle here


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -