html - Aspect ratio for background-image, when data is image/jpeg;base64 -


i have div background-image set data:image/jpeg;base64 format:

<div style="background-image: url(data:image/jpeg;base64,/9j/4aaq... 

i show full image respecting aspect ratio, using available space. use:

width: 90vw; height: 100vh; background-size: contain; background-repeat: no-repeat; background-position: center; 

in case image stretched using full div size. suggestions?

update: div data: http://jsfiddle.net/witepo/bksmhtwc/

update 2: expected result: http://1drv.ms/1utj8nd div: http://codepen.io/anon/pen/lezpjj

try this

background-size: cover; background-repeat: no-repeat; background-position: center center; 

Comments

Popular posts from this blog

java - Unable to make sub reports with Jasper -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -

Save and close a word document by giving a name in R -