one

one two

one two three

one

CSS:

            .header{
                height:60px;
                border:1px solid blue;
                
            }
            .header h2{
                float: left;
                width: 50px;
                margin: auto 10px; /* customize, or use padding */
                line-height: 60px;
                height:100%;
                border: 1px solid grey;
            }
            .header span{
                display: inline-block;
                line-height: 20px;
                vertical-align: middle;
                background-color: yellow;
            }
        

HTML:

            <div class="header">
                <h2><span>one</span></h2>
                <h2><span>one two</span></h2>
                <h2><span>one two three</span></h2>
                <h2><span>one</span></h2>
            </div>