Run the snippet below to see what I'm trying to achieve.
The main question is: Is that possible to achieve this without JavaScript?
.container {
display: flex;
width: 400px;
height: 2000px;
background-color: #aaa;
}
.left {
width: 150px;
background-color: lightgreen;
}
.right {
width: 100%;
background-color: lightcoral;
}
.fixed {
position: fixed;
height: 100px;
width: 100%;
background-color: skyblue;
}
<div class="container">
<div class="left">
My width can change anytime.
</div>
<div class="right">
<div class="fixed">
I'm fixed. Scroll the page to verify.<br /> I want to be the same width as my red parent.<br /> Any tips?
</div>
</div>
</div>