When working with inline elements inside block elements, you do not have many options for resizing the bounding box. min-height does not work on inline elements, and line-height will have no effect.
Setting the appropriate padding may be a smart option, but you will most likely run into problems when the background of an element overlaps other elements inside the containing block.
As a quick demo, try the following:
<!DOCTYPE html> <html> <head> <title>Demo</title> <style type="text/css"> span { background: #0F0; padding: 0.5em 0; } </style> </head> <body> <p>This is some demo text. Look at how <span>texty</span> it is.</p> </body> </html>
You will see that the background of the texty range expands vertically, but it overlaps the text in the previous and next lines. You can set the element display property to inline-block in modern browsers to avoid this problem, but then you will have an inconsistent line spacing, which will almost certainly be distracting if it is inside a block of text.
I think your best option, like this or not, is simply to ensure that the image you want to apply to your links matches the text you will be displaying.
Mike west
source share