I have two elements, one has a fixed width and is set to float to the right (red element) while the other is a full width block element (blue element). Normally, the blue element is behind the red element, as I expect:
<div style="width: 5em; height: 5em; background: red; float: right;"></div>
<div style="height: 2em; background: blue;"></div>
But when I add a CSS filter to the blue element, it now appears in front of the red element:
<div style="width: 5em; height: 5em; background: red; float: right;"></div>
<div style="height: 2em; background: blue; filter: brightness(0.8);"></div>
Is there any way to prevent this behaviour while still using float and filter?