Center a div content

Solved
DenyeDenye
New Member
1 0 0

I'm trying to align content of a div in center both vertically and horizontally, Can anyone help me with that?

0 Likes
f_malik
Excursionist
18 3 5

This is an accepted solution.

Hi there!

Place this code at the end of the CSS file

  .classname{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}