Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
katherinelowery
21,345 PointsBackground Image not Working
I have a page with an accordion menu and I wanted to add a background image in the upper left and right hand corners (to "frame" the page). No matter what I do they either move when I scroll the page and disappear behind the menu or when I click to open the menu they move down and are hidden. I've tried all of the options that come up for background-attachment but none of them are doing what I want. Please help.
2 Answers
Steven Parker
243,656 PointsDid you use: background-attachment: fixed; ?
If that's not it, can you post a link or include your CSS & HTML code?
Steven Parker
243,656 PointsYou could have something like background-position: left top;, but I dont think background-position: left, right; is valid.
I'm not sure what you mean by "end up behind the menu" - isn't that the whole idea of a background?
A link would be very helpful. If you don't have a live website, you could make a treehouse workspace and snapshot that.
katherinelowery
21,345 Pointskatherinelowery
21,345 PointsWith background-attachment:fixed; they stay visible if you scroll and end up behind the menu.
The css is just
.menu { background-image: url("../img/dragon.jpg"), url("../img/dragonr.jpg"); background-position: left, right; background-repeat: no-repeat; }
.menu starts right after the opening body tag and ends right above the opening footer tag