At the moment, I have three sections: left, center, and right. I want to add a fixed position div (notification) inside the center section so that it remains in place when scrolling. Additionally, I want this notification to resize according to changes in browser size while staying within the center div. Currently, when I use position: fixed, it uses the viewport instead of the center div.
The desired outcome is to have a blue notification bar that stays relative to the size of the center div with padding on the left and right. The blue bar should remain within the center div even when the browser size is decreased.
Current Display: Expected Display:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<div class="container">
<div class="row">
<div class="col-lg-2" style="background-color: red; height: 1000px">Test</div>
<div class="col-lg-7" style="background-color: yellow; height: 1000px">
<div style="display: block; position: relative; z-index: 9999; width: 100%; padding-left: 5; top: 50"><div style="position: fixed; background-color: blue; ">Notification</div></div>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
Test<br>
</div>
<div class="col-lg-3" style="background-color: green; height: 1000px">Test3</div>
</div>
</div>