Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

vertical and horizontal align center div

.center {
  height: 200px;
  position: relative;
  border: 3px solid green;
}

.center p {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
Source by www.markuptag.com #
 
PREVIOUS NEXT
Tagged: #vertical #horizontal #align #center #div
ADD COMMENT
Topic
Name
1+1 =