Answers for "flexbox move elements to center"

0

move text to center of page flexbox

// Assuming a horizontally centered row of items for the parent but it doesn't have to be
.parent {
  align-items: center;
  display: flex;
  justify-content: center;
}

.child {
  display: flex;
  align-items: center;
}
Posted by: Guest on April-15-2021
4

centering with flexbox

/* HORIZONTAL */
justify-content: center;

/* VERTICAL */
align-items: center;
Posted by: Guest on October-10-2020

Browse Popular Code Answers by Language