When designing my website, I encountered an issue with a "sticky element" and a series of images below it. As I scroll down, the "sticky element" ends up hiding behind the images, making it invisible. I'm seeking a solution to keep the "sticky element" visible as I scroll. I attempted using the CSS property "z-index" without success (it's possible I'm not utilizing it correctly).
<style>
div {
position: sticky;
}
</style>
<body>
<div>
"Sticky element"
</div>
<br>
<img src="https://www.cecidiomas.es/images/cecidiomases/684-thinking-of-getting-a-cat-international-cat-care-3435.png">
<br>
<img src="https://www.cecidiomas.es/images/cecidiomases/684-thinking-of-getting-a-cat-international-cat-care-3435.png">
</body>