I've three elements in my HTML code. I want to position the element fixed to the right side without removing it from the document flow.
<div class="container">
<header class="main-header">
</header>
<main class="main-content">
</main>
<footer class="main-footer">
</footer>
</div>
Here is the css code i'm using
.container {
display: grid;
grid-template-columns: 1fr 3fr;
grid-template-rows: auto auto;
}
.main-header{
grid-column: 1/2;
grid-row: 1/3;
/* Here i want this to be fixed (scrolling should not have any effect)*/
position: fixed;
}
position fixed remove it from the Document flow and everything look ugly. Can anybody tell me how to achieve this without using position:fixed; or without removing it from the document flow.