I want to have a color overlay on an image. Now this is pretty simple, but given the fact the image's border changes on hover, it isn't (for me, because I'm fairly new to CSS). I don't know if this is even possible with CSS, or would you have to use JavaScript (or JQuery)?
So far, I've tried this: put the image in a <div>
, which dynamically resizes on hover. This works pretty fine, but as I'm going to have a dark background, there is one little problem. There is a minimal 'border' of less than one pixel always around the image:
It's barely visible, but it annoys me. I've already tried to make the outside div smaller, but that leaves me with out-centered lines of not faded image and white border.
Take a look at my code here (nothing special, but just in case): JSFiddle
Is there some way of fixing this? I haven't learnt a lot of Javascript yet, so I would rather do it with css than with js, but if there's no other way...
I've updated some code; see http://jsfiddle.net/GR8Vq/:
Instead of a border-radius on the image holder, I used a :after selector to add a layer on top of the image. Should be better like this?