materialize icon indicating copy to clipboard operation
materialize copied to clipboard

0.97.3: Issue with responsive-img class

Open Sajonara opened this issue 10 years ago • 4 comments

I noticed a probable issue with responsive images in 0.97.3, which is the first version of Materialize I am using. Hence I cannot say if other versions have the same issue.

<div class="row">
  <div class="col s12" id="ngGallery">
    <h2 class="game-subheading">Title</h2>
    <img src="/x.jpg" class="responsive-img">
    <p>Description</p>
  </div>
</div>

If I open this in Googles Chrome (48.0.x) on a Mac for example the image is not resized to the container width. I checked the css with the inspector and found that only a max-width is mentioned. When I add a width tag with the same 100% the image resizes.

Sajonara avatar Dec 14 '15 21:12 Sajonara

it's because of the img isn't given any area you give it a s12 area and it's nature that it's shown big try this instead

right-codes.txt

MetaiR avatar Dec 16 '15 22:12 MetaiR

@MetaiR Thank you, but that's not the problem here. responsive-img just offers a max-width: 100%;. No width is given. width is, despite this case, a fallback for browsers which do not understand max-width. And as it seems Chrome 48 is one of them, or at least Google decided to change this behavior, because I know it was different in the past.

I explained that by using width: 100%; everything works as it should. So Materialize should add this style, to make sure it works.

As for your solution: The grid styling is only to apply on the grid, not on every single html element. :)

Sajonara avatar Dec 17 '15 01:12 Sajonara

i checked what you said with Chromume 47 and Firefox 42 but in both of theme max-width: 100%; worked currectly

MetaiR avatar Dec 17 '15 07:12 MetaiR

Please make a codepen of what you see as the problem On Dec 16, 2015 11:39 PM, "Seyed Ali Roshan" [email protected] wrote:

i checked what you said with Chromume 47 and Firefox 42 but in both of theme max-width: 100%; worked currectly

— Reply to this email directly or view it on GitHub https://github.com/Dogfalo/materialize/issues/2480#issuecomment-165373804 .

Dogfalo avatar Dec 18 '15 00:12 Dogfalo