 <p>First solution (seen in CSS-tricks website): use relative positioning like</p> <pre><code>.ratingstar:hover img, .ratingstar:focus img { position: relative; bottom: 3px; } </code></pre> <p>Second solution: play with padding-bottom going from 3 to 0px when margin-bottom goes from 0 to 3px, if your design permits it.<br> edit: It could also be border-top or bottom (same color as your background, if it isn't a gradient or image but a unique color)</p>