Trying to add rounded corners to images, that also have a border.
Came up with the following:
But it doesn’t look good at all with the whitespace below the image, and the fact that the corners of the border and image don’t match. Am I doing something wrong?
Thanks,
Wesley
Add
overflow:hidden;to.thumb_container, addvertical-align:bottom;to the image.You can remove a lot of the other values, here is an updated jsfiddle:
http://jsfiddle.net/tgqBG/12/
Another way of doing this (supported by more browsers) is showing the image through
background-image. In my comment I said this would pose a problem because the element needs fixed dimensions, however I just realized this can easily be fixed by also putting the image in there but hiding it.http://jsfiddle.net/tgqBG/51/
This doesn’t work without
floatbecause it will get a width of100%. This is because ofdiv‘s automatic property to be rendered as ablock.To fix this, change
divtospanand then adddisplay:inline-block;.http://jsfiddle.net/tgqBG/52/