html - Sticky elements with background-attachment as fixed -
consider this: http://jsfiddle.net/yp7nf
sample code:
<div class="first"><img src="http://placekitten.com/g/200/300"/></div> <div class="second"></div> <div class="third"></div> .first { background-color: #a6a6a6; height: 600px; background-attachment: fixed; background-image: url("http://placehold.it/1000x500"); } .second { background-color: #fff; min-height: 500px; } .third { background-color: #ff0000; min-height: 500px; background-attachment: fixed; } i want cat picture stay sticky second div ('.second') can cover same way covers background.
i want simulate same behaviour background-attachment:fixed cat picture.
help.
on image, use position : fixed prevent scroll, , z-index:-1 make go behind things
if goes behind don't want, use z-index:-2 on it
Comments
Post a Comment