<!DOCTYPE html>
<style>
.container {
    position: absolute;
    width: 100px;
    height: 100px;
    background: red;
    display: flex;
    justify-content: end;
}
.top-right {
    position: absolute;
    width: 50px;
    height: 50px;
    margin-left: 500px;
    background: green;
    border: 5px solid black;
    padding: 5px;
}
</style>
<div class="container">
  <div class="top-right"></div>
</div>
