It would require an additional request if you do it like that. In the header, your CSS file will be loaded and any javascript, etc. If you use inline styling, it would require an additional request to render that image instead of already having it loaded through your stylesheet.
@abhishek: If you are using a 1x1 pixel image, you could just convert it into a data URI. Then you don't have a HTTP request to worry about. It'll look similar to this:
The only problem is there is no way to cache it (I think) and you will have to repeat this format every time you need the same image.
I got the above img tag example from wikipedia but you can use an online converter to make your own URI string. Please note that larger images make for much larger URI strings!
Edit: Now that I think about it, a better method for you would be to use one of the other images that you are already using on the page and just clip it. That is if that image has a transparent area. So assuming the top left corner of your image is transparent, your code would look something like this:
So the code is - and css is
Is this the correct alternate method to use CSS Sprite or it defiles the logic of reducing HTTP requests?
So is it worth the time?
PS: @ChristopherBurton thanks for quick response
I got the above img tag example from wikipedia but you can use an online converter to make your own URI string. Please note that larger images make for much larger URI strings!
Edit: Now that I think about it, a better method for you would be to use one of the other images that you are already using on the page and just clip it. That is if that image has a transparent area. So assuming the top left corner of your image is transparent, your code would look something like this:
HTML CSS Here is a post that Chris made about it with more detail.