.relative {
    width: 10rem;
    height: 10rem;
    background-color: red;
    position: relative;
    left: 20px;
    top: 10px
}
.wrap {
    width: 100%;
    height: 30rem;
    position: relative;
}
.absolute {
    width: 10rem;
    height: 10rem;
    background-color: blue;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.fixed {
    height: 5rem;
    width: 100%;
    background-color: green;
    position: fixed;
    top: 0;
}