size - CSS: Background image to stretch and squash to 100% area of div with no overflow no repeat -


i have graphic shape background image stretch fit entire area of responsive dynamically-changing div (containing text) without need retain proportion, image stays @ 100% width , height without overflow.

i've tried using usual background-size set 'cover', 'contain' , '100% 100%' these seem retain proportion. thought "100% 100%" it, height doesn't stretch when width condenses , text wraps on more lines.

is possible?

many thanks!

you can try

background-size:100% 100%

body { width:100% ; height:100%;}

or

use object-fit: fill;

fill:the entire object fill box. if object's aspect ratio not match aspect ratio of box, object stretched fit.

refer:https://developer.mozilla.org/en-us/docs/web/css/object-fit


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -