To add CSS classes to a visual, navigate to the Custom Style menu, and enter the name(s) of classes in the text box for the option Enter CSS classes for the visual.
To add CSS classes to a dashboard, see Adding CSS Classes to Dashboards.