Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

center flex

/* Row centering */
div {
  display: flex;
  flex-direction: row; /* Optional -- default flex-direction is row */
  justify-content: center; /* center horizontally */
  align-items: center; /* center vertically */
}
/* Column centering */
div {
  display: flex;
  flex-direction: column;
  justify-content: center; /* center vertically */
  align-items: center; /* center horizontally */
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #center #flex
ADD COMMENT
Topic
Name
2+9 =