Answers for "style how to center a div"

CSS
89

center a div in css

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

how to center a div

.MyDiv{
  	display: block;
  	margin-left: auto;
	margin-right: auto;
}
Posted by: Guest on August-31-2021
6

how to center a div

.div {
	width: 80%;
    margin: auto;
}
Posted by: Guest on September-27-2021

Browse Popular Code Answers by Language