Open this example in the interactive library
Source code
<style>
.demo {
position: relative;
left: 1rem;
top: 0.5rem;
width: fit-content;
}
</style>
<div class="demo">Offset a relatively positioned item</div>
Offset a relatively positioned item with native CSS. The preview includes a small shared demo stylesheet.
Open this example in the interactive library
<style>
.demo {
position: relative;
left: 1rem;
top: 0.5rem;
width: fit-content;
}
</style>
<div class="demo">Offset a relatively positioned item</div>