Answers for "div html align center"

CSS
23

center with css

.parent {
  position: relative;
}
.child {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
Posted by: Guest on January-03-2020
4

div align center

.center {
  text-align: center;
}

// or

<div style="text-align:center">
</div>
Posted by: Guest on February-17-2021
0

center div html

//Center DIV HTML5

<body>
    <div style="width:800px; margin:0 auto;">
        centered content
    </div>
</body>
Posted by: Guest on July-30-2021

Browse Popular Code Answers by Language