Answers for "Centering a div of unknown height and width"

CSS
1

Centering a div of unknown height and width

/*<div class="content">This works with any content</div>*/
.content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
Posted by: Guest on March-12-2022

Code answers related to "Centering a div of unknown height and width"

Browse Popular Code Answers by Language