Avoid the image going beyond the div?
I have:
<div style="height:15px"> <img src="image" /> </div> The image is larger than 15px, so it is outside the div when you see it. How to "crop" an image (show only its port 15px), only using css?
+6
Somebody still uses you MS-DOS
source share6 answers
You need overflow:hidden see an example here:
http://www.jsfiddle.net/S8qAq/
Read about overflow : here W3Schools
Good luck
+9
Trufa
source shareTry giving overflow:hidden div.
+3
Etienne de martel
source shareadd overflow:hidden; into your div style.
+1
wajiw
source shareUse the overflow css property:
overflow: hidden; +1
Rabid fire
source shareusing
overflow:hidden; +1
Breezer
source shareI am surprised that no one suggested object-fit: cover;
0
Javaish
source share