css - Vertically center element on HTML page with some content on top (Bootstrap) -


i building website using bootstrap, has (minimal) content on top (basically title, subtitle, , navigation bar). able center div both horizontally , vertically. contents of div small, login or search widget.

what recommended way in bootstrap , css? of course want "good" when opened on phone. content on top rather minimal, on small screen, it's unlikely top , center touch. different other questions in style, because have content on top. guess try follow 1 of answers, , "absolutely" place content on top, somehow doesn't seem clean. there better solutions?

kristof hi there. search have given answer on how this.
fiddle want here.

.centerthis {   position: absolute;   top: 0;   bottom: 0;   left: 0;   right: 0;   margin: auto;   } 

enter image description here


Comments