When building web pages, one of my colleagues displays any logo using the CSS background-image property, rather than embedding the image using an HTML <img> tag. The colleague reported it was to reduce the number of HTTP requests. He also showed me an image sprite and said that Google displays its logo with sprite images.
I don’t agree with his approach and showed him that the main Google.com page loads their logo in an <img> tag.
Which is a better practice?
EDIT:
Facebook also do the same thing on their homepage, loading the logo in an img tag while on their profile pages they display their logo using a CSS sprite.
From this my conclusion was that perhaps you should load your main logo in an img tag while for the other logos such as in a footer or subpage you might want to load them in the background using CSS sprites.
UPDATED: I am routinely loading logos with img tags and also know why we might use sprites. My main question is: if you have three or more logos on a page, what is the better way to load them?
A logo is part of the content of your site, therefore it should be in an
imgtag, not as a background image. It will help to increase SEO (adding a title and alt attribute will too) and the reason companies like Google, Facebook, et al put their image in a sprite is for load times – not SEO enhancement.Does your company have the same SE rank as Google or Facebook? No. Until then, keep putting the logo in an
imgtag where it belongs. When your site is consistently the most viewed site on the internet, then you can start thinking about performance more than SEO.Also, as an aside, if the logo ever had a tweak (size, color, etc), the sprite would have to be recreated as well as the CSS. If it was just an
imgtag, this hassle is nonexistent.