Answers for "how to align vertical in css"

CSS
7

css vertical align middle

/* Flex */
.center {
  	display: flex;
  	justify-content: center;
  	align-items: center;
}
/* Without Flex */
.parent {
  	position: relative;
}
.child {
  	position: absolute;
  	top: 50%;
  	transform: translateY(-50%);
}
Posted by: Guest on April-19-2021
11

css vertical align

.top-align {
	vertical-align: top;
}  

.center-align {
  	vertical-align: middle;
}
Posted by: Guest on February-15-2020
2

vertical align css

/*
For a flexed item you can you align - items to center content vertically
you can use justify content to center horizontally
*/

.container {
  display: flex;
  align-items: center;
  justify-content: center;
}
Posted by: Guest on December-15-2020

Browse Popular Code Answers by Language