View Single Post
Old April 18th, 2013 (4:21 PM).
KingCharizard's Avatar
KingCharizard KingCharizard is offline
C++ Developer Extraordinaire
Join Date: Dec 2009
Location: Pennsylvania
Age: 27
Gender: Male
Nature: Bold
Posts: 1,246
Classes and IDs are used for very different things. Classes are things that you can use anywhere for style or code functionality purposes, whereas IDs are definite anchors to particular elements. How you separate your CSS between the two is a large part of making modular CSS. For example, I commonly have highly general CSS classes that I can add to things, like an "error" class that will turn text red, or if it is a particular type of element, to draw a little warning sign next to it. Another common one is "loading" which will change the background with a pulser animation to indicate something is in progress.

That way if there is an error in validation, the only thing I have to do is get a handle on the element and add the class "error". Also if I am waiting for an AJAX call to return I can set the "loading" class when it starts, and remove it when it's done.

You can automate an awful lot with CSS classes, because you can use them to reference hierarchies too, so you can have a selector for "div.someclass div.content" to act on anything that was below that element with the class. This means you can make huge graphical changes with a simple adding or removing of a single class from an element.

Don't neglect tools if they prove useful.
Very good points, especially the error one.

Another thing I've been considering is following photoshop tutorials about template design. Even though its copying it can give me a better feel for interface/ui design. My project I've been working on now is making a registration/login system with form/processing to log into a simple page. Nothing extreme just enough to design a good login/registration system. Mainly so I can focus on the design.

Anyone else have any helpful advice or links?
My personal website. UPDATED 8/29/2013
Reply With Quote