silly question, but I can\'t find answer on it as all answers assume centering div in terms of width.
What I need is to center div in means of height and width so in a v
Create a wrapper with ID wrapper around the #myDiv element, and apply this CSS code:
wrapper
#myDiv
#wrapper{ display: table; } #myDiv{ display: table-cell; vertical-align: middle; /*Vertically centered*/ text-align: center; /* Horizontally centered */ }
This code centers elements of any width/height.