Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

vertical align center div

/* Flex */
.center {
  	display: flex;
  	justify-content: center;
  	align-items: center;
}
/* Without Flex */
.parent {
  	position: relative;
}
.child {
  	position: absolute;
  	top: 50%;
  	transform: translateY(-50%);
}
Source by css-tricks.com #
 
PREVIOUS NEXT
Tagged: #vertical #align #center #div
ADD COMMENT
Topic
Name
2+9 =