![]() I tried a bunch of different things, starting over included, but found height was essentially always ignored and would overflow. always make the image as big as it can until one of the dimensions would go offscreen. I found contain always made my image tiny (original image was large).Ĭontain was with some hacks closer to what I wanted than cover, which seems to be that the aspect is maintained but image is scaled to make the smallest-dimension match the screen - i.e. I found contain behaviour didn't seem to match the documentation I could find anywhere - I understood the documentation to say contain should make the largest dimension get contained within the screen (maintained aspect). It may also work for background-image though I gave up on trying that kind of solution after cover/contain didn't work for me. ![]() ![]() This scales the image to be 'fullscreen' (probably breaking the aspect ratio) which was what I wanted to do but had a hard-time finding. In my case I'm actually trying to do it with an img tag, not background-image, though it should also work for background-image if you use z-height: I found the above solutions didn't work for me (on current versions of firefox and safari at least).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |