Forums

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

Home Forums CSS How to do a cover but fixed background

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #174982
    alienlebarge
    Participant

    Hi,

    I’m trying to build an article page with a nice background image on the header.
    I want this image to cover element and to be fixed.

    When I set background-attachment: scroll; everything works but with background-attachment: fixed; the image get his original size instead of the size of the div

    Here the pen

    I hope somebody can help me ;)

    (Excuse me for my english)

    #174983
    Alan C
    Participant

    This has actually been an issue for a while now. As far as I know there is no way to fix it using just CSS, though in the article below a couple of people have posted some work-arounds that might be worth a shot.

    http://www.carsonshold.com/2013/02/css-background-sizecover-doesnt-like-fixed-positioning/

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