diff --git a/flowtype.js b/flowtype.js index 5ed5162..bdcada8 100644 --- a/flowtype.js +++ b/flowtype.js @@ -32,6 +32,13 @@ fontBase = width / settings.fontRatio, fontSize = fontBase > settings.maxFont ? settings.maxFont : fontBase < settings.minFont ? settings.minFont : fontBase; $el.css('font-size', fontSize + 'px'); + + // Center vertically in the parent Div + var myHeight = $el.height(), + myParentHeight = $el.parent().height(), + myPaddingTop = (myParentHeight - myHeight) / 2; + + $el.css('padding-top', myPaddingTop + 'px'); }; // Make the magic visible @@ -45,4 +52,4 @@ changes(this); }); }; -}(jQuery)); \ No newline at end of file +}(jQuery));