CSS Always On Top

css, html, image

Solution

Ensure `position` is on your element and set the `z-index` to a value higher than the elements you want to cover.

element {
    position: fixed;
    z-index: 999;
}

div {
    position: relative;
    z-index: 99;
}

It will probably require some more work than that but it's a start since you didn't post any code.

Problem

I have a website with a fixed image at the top of my screen. When I scroll down my page the image stays at the top like it should. However, all content below overlaps my image and it is then covered. How do I make my top bar (image) always stay on top? I want it to cover the content of the page as you scroll.

Original source