html - How to hide part of image if the image length is too long for mobile devices -
When the image is too long, I am having trouble changing the image again. I have a Lider for my mobile website Most of the images are now in width, so they are mapped properly and my content does not go too far. But when the image is long in height, I want to see a padding in the picture and only the middle part of the image should be visible
& lt; div id = "ok" & gt; & Lt; Img src = "img.jpg" & gt; & Lt; / Div & gt; CSS: # OK {width: auto; Height: 400px; Overflow: hidden; } # Oak img {width: 200px; Height: auto; }
The above code is an example for an image 200px wide and the height is limited to 400px. If the image is overflow or overseed, then the area is hidden which is overflow.
Comments
Post a Comment