html - display background image that needs to repeat but does not have a repeating pattern -
i have background not have obvious repeating pattern , need adding webpage background.
the attached image main page background. after web browser hits 1280+ px, main background stays in center , right , left sides fade out white seen in attached image.
i don't know how can smooth transition of background once page height larger height of background image height, there no repeating pattern , don't know of way make smooth/seamless transition once page height reaches point.
this interesting mind exercise. i'm sure there many ways accomplish this, way achieve offhand div has opacity gradient , media query.
create div before closing </body>
tag, , give whatever height want 'fade-out' be.
<div id="fadeout"></div>
and in stylesheet:
body { background: url('http://i.stack.imgur.com/70dux.jpg') top center; background-repeat: no-repeat; margin: 0; } #fadeout { display: none; } @media , (min-height: 529px) { #fadeout { display: block; width: 100%; height: 100px; position: absolute; top: 439px; background: #333; background: -webkit-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,1)); } }
this should give appearance of fadeout white background. configure heights correct background height, used 529px because that's how big image listed above is.
jsfiddle here: http://jsfiddle.net/prex/kawce/
Comments
Post a Comment