One of my favourite css rule is the following, to make sure images never grow outside their parent element. Simple but very effective in my day to day work. :)
It's a good one. May I suggest using max-width instead of width. The former will make sure the image doesn't stretch if its width is smaller than the parents'.
One of my favourite css rule is the following, to make sure images never grow outside their parent element. Simple but very effective in my day to day work. :)
Yes, I use this all the time as well! Very helpful. Thanks, Stephan!
It's a good one. May I suggest using
max-width
instead ofwidth
. The former will make sure the image doesn't stretch if its width is smaller than the parents'.You are absolutely right. I changed the example! :) Thanks.