position: static | relative | absolute | fixed | sticky;
.el-undone { height: 40px; line-height: 40px; background-color: #f40; box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.4); }
.el-done { // MUST position: relative; height: 40px; line-height: 40px; background-color: #f40; box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.4); // 不指定层级,默认在最上层 // z-index: 1; }
.inset { position: relative; width: 180px; aspect-ratio: 16/9; border: 1px solid var(--txt-warn-color); margin: 1rem auto; } .inset::before { content: ''; position: absolute; inset: 20px 0; background-color: var(--txt-warn-color); }
.container{ position: relative; } .item { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); // translate: -50% -50%; }