CSS background-position 100% (right) not working as expected -


i have simple div width less 100%, background image having background-position 100% 0. instead of bg image sticking right side of div, getting cut off, , seems think actual right position edge of body, not div background is.

.bg {     width:80%;     height:500px;     background-repeat: no-repeat;     background-attachment: fixed;     background-position: 100% 0;     background-size: 50%;     background-image: url(http://www.blackitty.net/photographs/photos/slideshow/slide/133/tofino_2013-11-24.jpg); } 

i made fiddle it: http://jsfiddle.net/bobmeador/j2mwx/ upper element shows problem. below full image can see getting cut off.

any idea why seems using parent positioning rather div belongs to?

i have same result when .bg div set width 100% , inside div set 80% width. seems ignoring container widths , using overall body width 100% reference.

i tihnk problem background-attachment: fixed;, if remove image aligns right.

http://jsfiddle.net/j2mwx/2/


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -