Skip to main content

Forums

This topic contains 2 replies, has 3 voices, and was last updated by  Pranab 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #269918

    jamesb0nd
    Participant

    Can you set an image to fill 100% of a container’s width except when the container’s width exceeds the image’s natural width?

    I find the distortion of the enlarged image more noticeble than the shrunken image.

    #269920

    bearhead
    Participant

    You should be able to do this by applying max-width:100%; to the img element.

    #269963

    Pranab
    Participant

    You can do that just to set the width of the image 100% and it will follow the container.

    Like that img{width: 100%};

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

icon-link icon-logo-star icon-search icon-star