Answers for "center align items in display inline block"

CSS
4

inline block align center

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

.child {
  display: inline-block;
}
Posted by: Guest on November-10-2020
0

how to center a inline block element

display: inline-block;
  position: relative;
  /* Move the element to the right by 50% of the container's width */
  left: 50%; 
  /* Calculates 50% of the element's width, and moves it by that */ 
  /* amount across the X-axis to the left */
  transform: translateX(-50%);
Posted by: Guest on December-23-2021

Code answers related to "center align items in display inline block"

Browse Popular Code Answers by Language