treehouse : what would you like to learn today?
Web Design Web Development iOS Development

CSS Background: similar to fixed and cover, but repeat vertically?

  • Does anyone know if this is possible? I am trying to create a background that repeats vertically, but will fill the entire width of a screen, no matter how large or small the screen is. Similar to the way this code below would operate, but repeating on the y-axis, so therefore not fixed:
    body {background: url(images/bodybg2.png) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    }
    Please help! Thanks!
    Angela
  • Off the top of my head, you would need to use some JS. Even then, I'd want to use background-size, which has no ie7/8 support.