html - Cannot change image height in Firefox when loading image from css -


i have simple img loaded css. image has height of 300px, , trying stretch vertically 700px:

<div>     <img class="test"> </div> 

currently have as:

.test:after {     min-height:700px;     height:700px;     content: url('/test.png');     overflow:hidden;     display:block;     width:100%; } 

this works in chrome. in firefox, image not stretch; keeps original height , there big block of empty space below it. replace content: url(...) background-image: url(...) , background-repeat: no-repeat. still same result.

why firefox not stretching image vertically in either case? how stretch image?

also, know can use src want load css , without javascript.

from

https://css-tricks.com/almanac/properties/c/content/

image

div::before {   content: url(image.jpg); } 

this literally image on page be. gradient. note cannot change dimensions of image when inserted way.

but @ point they're offering solution:

you insert image using empty string empty string content, making display: block in way, sizing it, , using background-image. way re-size background-size.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -