CSS Best-Practice: Selectors or Classes / IDs?

css

Solution

The choice will depend on how your HTML is structured. If a certain style is used more than once, use classes. If a style used only for a specific tag, use IDs. Regarding the selectors, the trick is to keep them as short as possible.

Problem

What is the truly a best-practice in CSS: Using IDs and Classes or Selectors? I have a stylesheet that is required by PHP once a form is submitted to style the results / successful-submission page and I was wondering what is a best-practise in CSS to use IDs and Classes or to use Selectors ?

Original source