//* vertical alignment inside block-level elements with defined heights */ .valign-children, .valign-children-top, .valign-children-middle, .valign-children-baseline, .valign-children-bottom { position:relative; &:before { //* the vertical-align with before-pseudo-content trick */ content:""; display:inline-block; position:relative; width:0; margin:0; padding:0; height:100%; //* 100% makes this pseudo-content element height the valign reference for adjacent siblings */ min-height:inherit; //* if the parent's height is only defined as min-height (wich is a non-explicit height css cannot derive 100% of) we simply inherit it */ } > * { display:inline-block; float:none; /* vertical alingment won't work with float */ max-width:100%; //* constrain width to prevent initial line breaks in case of overflow */ } > *:not[class*="-offset-"] { //* zero side margins for all children except ones using bootstrap offset */ margin-left:0; margin-right:0; } > * > *:first-child, > * > *:first-child { margin-top:0; //* zero first-in-children elements' top margin */ > *:first-child { margin-top:0; //* zero first-in-childrens-first-child elements' top margin (if section content is wrapped with an additional