Hey When using CSS am I supposed to give each image a class tag of it's own or do I use one class tag for images if they are going to have the same properties? Also do I put all the images in the same CSS document as everything else or would it be better to have a separate CSS document?
You would want to use the same class for multiple images if they have the same properties. Classes should be used to style multiple things the same way; ids should be used to style (and identify) one element per id. Generally, I keep one single .CSS file for every page on a site. That way I can easily change the appearance of my documents. Having many short .CSS files can slow page load down more than using a single long .CSS file.
Thanks! I guess as the fomat of sites remains very much the same regardless of the size so you would only end up with a few class tags for images. Cool, thanks again!
You don't need the classes if the same group of images are sharing a common parent - you can just target them directly via their parent, like so: #images img { /* style rules */ } Code (markup): This bit of CSS would affect all IMG elements contained by an element (whatever it is) with an ID of "images" so you can see there will be no need to waste classes (Jeffrey Zeldman calls it "class-itis" in case you're wondering) in situations like this.
Which you see WAY too often - classes on EVERYTHING, inlined styling repeatedly on ten elements in a row, etc, etc. I like to think of it how George Carlin describes being pro choice... "Not every ejaculation deserves a name." Which is very appropriate given some of the code we see out there.
Here is just a quick clarification. I know this is what you meant, but this might be a bit more clear for those new to CSS. You can use an ID only once per page. Thus, if you have an element that only shows up once on a page, but is on many pages, you would use an ID. Most of the time I have more IDs than Classes when I design a page. BTW KatieK, I really like your sig. NINJAS Rock! (If I ever say anything that you disagree with, and you decide that I need to be killed, please do it quickly)