Aron Schatz2014: Year of change.Joined: August 3, 2001Status: OfflinePosts: 10753Rep:
CSS: IDs or Classes Wed Mar 1, 2006 7:53:05 PM#15102Perm Link
For the current theme (the non XHTML one), I've been uses classes and using the same classnames for many items (ie: titlebar1, gen, info, summary). For the XHTML theme, I'm doing very specific IDs. The problem that I see is that, while the site would be easily changed by editing the CSS, the CSS file is getting large and it isn't easy to make a minor change for things that look the same.
For example, the comments and the messages have the same CSS. In the XHTML, they would be completely different (but the same). This is a just in case thing to me. Another example is the uniform boxes that I'll be using for the XHTML theme. They all consist of a container which contains a header and a content div. Up to now, I've been declaring IDs of things that have the same attributes (presentation wise).
Many things should get IDs on the page, I agree. The sections (titlebar, pagecontent, tail) will all have IDs. The entire page will have an ID (something special coming up with that).
I am just wondering if it is okay to use IDs everywhere or stick with classes. I use classes for generic things such as centering or width expansion, but it isn't needed with IDs.
2014 is going to be a good year. More content, more streamlining. Be a part of history!
I always use classes for generic things, like stuff per forum post on this site and IDs for pretty much all single things like, say, the logo. When things look similiar but should be seperate things, I seperate the CSS for the items into common parts, i.e.