Save 36% for Black Friday! Learn more

All threads / Possible to get img elements to be the size of container and behave like background-image?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Possible to get img elements to be the size of container and behave like background-image?

DomnikBritto asked in General

I’m using a grid for a complex layout and I would like the images in it to have no control over size. The grid is set using fr unit https://sarkariresult.onl/ s so that it too will not have an actual height, but instead just fill the space of its container.

I’ve set the images to 100% which fills the cells, but their ac mobdro tual pixel dimensions still have control over the the grid. I would expect the grid to collapse completely when there’s nothing in it that has an explicit height, but this is not what happens. The images intrinsic size still exerts some control. https://pnrstatus.vip/

It does work when I set images using background but that’s semantically incorrect for my use case.

Is this possible?

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 39,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.