Answers for "how can i center element with css"

CSS
89

center a div in css

.container {
  display: flex;
  justify-content: center;
  align-items: center;
}
Posted by: Guest on September-09-2020
1

how to make things center using css

// add to the parent element
.parent{
  	height:100vh;
	display:flex;
  	justify-content: center;
  	align-items: center;
}
or you can use 
// add to the parent element
.parent{
  	height:100vh;
	display:gird;
  	place-item:center;
}
Posted by: Guest on May-18-2021
1

center a div css

/* 2 Ways to center a div in css */
/* Display Flex */
.center {	
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Display Grid */
.center {	
  display: grid;
  place-items: center;
  min-height: 100vh;
}
Posted by: Guest on September-16-2021

Code answers related to "how can i center element with css"

Browse Popular Code Answers by Language