Units

rem - Relative to font-size of the root element (html)

em - Relative to the font-size of the element

ch - Relative to the width of the "0" (zero)

vw - Relative to 1% of the width of the viewport

vh - Relative to 1% of the height of the viewport

% - Relative to the parent element

fr - a unit which represents a fraction of the available space in the grid container

Vertical/center align

With Flexbox

.outside-element {
  display: flex;
  align-items: center;
  justify-content: center;
}

With translate

.element {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

You can also center align..

.element {
  left: 50%;
  position: relative;
  transform: translateX(-50%);
}

Or do both, I use shorthand translate here...

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