css - div/span and sprites -


I am replacing most inline images with a sprite on my site.

Some basic CSS in the phantom class:

  .sprite {background-image: url (...); Background Status: ...; Width: 16px; Height: 16px; }  

I noticed that the nesting device inside the anchor tag is not a good idea.

  & lt; A & gt; & Lt; Div class = "sprite" & gt; & Lt; / Div & gt; & Lt; / A & gt;  

I have tried to add span elements instead.

  & lt; A & gt; & Lt; Span class = "sprite" & gt; & Lt; / Time & gt; & Lt; / A & gt;  

But the span elements do not extend to the width and height set by me. Being able to use span elements to replace image tags with spreads would really be useful. I can add a blank GIF image to the span element to expand.

The use of devil elements inside an anchor tag is not right.

So how can I use sprites inside an anchor element?

And there is always the problem of div alignment. If one image is concentrated in another element, then how do I change it with the phantom?

You display: block; Announce your span elements that are in accordance with the default inline elements:

  .sprite {display: block; Background Image: URL (...); Background Status: ...; Width: 16px; Height: 16px; }  

This should extend the span elements to your desired width / height.

Hope it helps!


Comments