Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Responsive Image width:inherit

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #41235
    dengland
    Member

    Was having trouble matching a image width, found that

    #footer img {
    width: inherit
    }

    worked well for me. However, it seemed to make the page load slower.

    #116653
    tbwiii
    Participant

    Hadn’t thought of that. I [opened up a JSFiddle][1] to play around with it.

    Your implementation only works if your image’s container has a fixed width or if it has a percentage based width of 100%.

    If say the container has a 40% width then the image will only take of 40% of its container.

    I’m not saying don’t use inherit – just to be aware of that behavior.

    [1]:http://jsfiddle.net/m65Mz/2/

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.