I want to position my element relative to my window for which i use fixed position but in one case it does behave strange.
My code looks like this:
<div style="
padding-left: 5px;
padding-right: 5px;
margin-left: 50%;
transform: translateX(-50%);
display: inline-block;
max-width: 300px;
width: 300px;
background-color: red">
something
<div style="width: 100px; height: 100px; background-color: blue; position: fixed; left: 0">
Gallery
</div>
</div>
As you can see second element is fixed and IT HAS TO BE inside first element but for some reason translate
property also moves fixed child elements. What can i do to achieve this?
Here is the fiddle: Fiddle