0.97.3: Issue with responsive-img class
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.
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
@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. :)
i checked what you said with Chromume 47 and Firefox 42 but in both of theme max-width: 100%; worked currectly
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 .