Answers for "center div on page"

CSS
88

center a div in css

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

center div in middle of page

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  /* bring your own prefixes */
  transform: translate(-50%, -50%);
}
Posted by: Guest on March-01-2020
44

css center image

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
Posted by: Guest on November-28-2019
2

center on page css

body {
  display: grid;
  place-items: center;
  height: 100vh;
  margin: 0;
}
Posted by: Guest on June-01-2021
15

css align items vertical center

.parent {
  display: flex;
  justify-content: center;
  align-items: center;
}
Posted by: Guest on October-31-2020
2

how to make a division center css

position:absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
Posted by: Guest on September-25-2020

Browse Popular Code Answers by Language