html - Any way to set CSS background size to be 100% of image size but not more than 100% of container size? -
i've got large div users can swap out backgrounds either patterns or own images. small background images not sized cover entire div, want images repeat horizontally , vertically , not stretch on 100% of natural width. larger images cover more width of div, want limit not stretch beyond 100% of div width entire width of image visible.
is there way accomplish without using javascript?
plunker here:http://plnkr.co/edit/pkx49a3ku34ysupqlcrs?p=preview
#background1
should repeat is
#background2
should not stretch beyond 100% of container width
to clarify, i'm looking solution doesn't involve js , work both cases (can't add styling specific element)
Comments
Post a Comment