Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to push all the elements of a page down.

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #271193
    vishnu-vv
    Participant

    I need to display a banner on top of the page, pushing all other elements down.
    All the elements including the fixed/sticky header, top-0 elements etc. should be pushed down and the banner should be sticky.

    How can we implement this with pure CSS and Javascript?

    Thanks in Advance.

    #271513
    JeroenR
    Participant

    Something like this: https://codepen.io/jeroenreijs/pen/MGxqmW
    I used this example for the page: https://getbootstrap.com/docs/4.0/examples/album/
    And this solution for the sticky banner: https://www.w3schools.com/howto/howto_js_sticky_header.asp

    #271516
    vishnu-vv
    Participant

    @JeroenR

    Thanks for your reply.

    But i need to add the banner to third party websites, I can’t predict the HTML structure of their webpage. Like there can be banners fixed on their sites already, but we should not overirde their CSS, but just push all the elements down and show ours on top of everything.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.