html - Resizeable div with background image -


i have div background image:

<div id="mydiv">    ... </div>  #mydiv {    background-image: url(...);    width: 70%;    max-width: 200px; } 

now, want background image resized fit div. this, added background-size: 100%. solves problem regarding width, height accomodates content of the, , since content of div smaller, image cropped in bottom. should set height attribute follows resizing of width?

if understand well, want background streched , fit exactely div. in case, try set both values of background-size property in way:

background-size: 100% 100%; 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -