Should all presentational images be defined in CSS?

Posted by Grant Crofton on Stack Overflow See other posts from Stack Overflow or by Grant Crofton
Published on 2010-06-16T10:26:08Z Indexed on 2010/06/16 10:32 UTC
Read the original article Hit count: 179

Filed under:
|

I've been learning (X)HTML & CSS recently, and one of the main principles is that HTML is for structure and CSS for presentation.

With that in mind, it seems to me that a fair number of images on most sites are just for presentation and as such should be in the CSS (with a div or span to hold them in the HTML) - for example logos, header images, backgrounds.

However, while the examples in my book put some images in CSS, they are still often in the HTML. (I'm just talking about 'presentational' images, not 'structural' ones which are a key part of the content, for example photos in a photo site).

Should all such images be in CSS? Or are there technical or logical reasons to keep them in the HTML?

Thanks, Grant

© Stack Overflow or respective owner

Related posts about html

Related posts about css