关于居中的n种方法(持续填坑)

164 阅读1分钟

1.flex布局

2.text-align

3.定位方法

.band-confirm {
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
}

4.定位+flex

.to-center {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}