I had the same question when I was starting out with CSS. A lot of is simply trial and error, and you figure out what is best. Buy a good book on CSS (I read Bullet Proof CSS design), and that will give you some guidance as to what's the best class/id naming style. In general I follow these rules:
1. Use ID for unique element. 2. Use class for shared elements. 3. Scope CSS selector properly, so it's as specific as possible. It's a terrible thing to work on a code base where the previous developer specified style on something generic like ".first", then everything in the site that is of class "first" would be impacted by this style. On Feb 17, 5:44 pm, itsastickup <[email protected]> wrote: > I'm having to design the UI to a small site, and that means dabbling > in css. I've never been able to get any kind of decent idea as to how > to decide on classes and id-ing. I've had a sniff around the internet > without success: people seem to be as clueless as me. I've even > examined the css/markup of a few sites and it hasn't been > enlightening. > > Does anyone know of a good source of info on css class decisions, and > ids? Even better with rails inm ind. Something that broke through for > you might be good. I'm not so interested in how css works: that's easy > to find, and I have a pretty good idea already. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

