Forums

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

Home Forums CSS mix of scroll and fix background image

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #153795
    MS
    Participant

    Hi I was trying to set vertical sized background but i face a problem where

    i cant make the background fixed so what ever i scroll the image is on the background, and at the same time i need the background to scroll just as the height of the background image.

    I am wonder if there is a solution using CSS only

    Thanks

    #154009
    lukefrake
    Participant

    Hello Krish,

    Would this do what you want?

    background: url(“IMAGE”) center bottom no-repeat fixed

    You can put a background color in as well like this

    background:#000000 url(“IMAGE”) center bottom no-repeat fixed

    If you don’t want to see the background color you can use this decloration to cover the entire screen.

    background-size: cover

    #154081
    MS
    Participant

    i think you guys didnt understand my mean

    i need to be able to scroll only the backgound image height not the container

    #154119
    lukefrake
    Participant

    Sorry MS I don’t understand still, do you have a codepen of your problem and then explain what you want to do :)

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