As a general rule, I use classes for elements that I know I’ll be using multiple times within a document. All other elements that only appear once within a document will be given the unique identifier (ID).
I do try to avoid using IDs and classes wherever possible, however. Sometimes you can accomplish a lot by just using the cascade.
Your above example does not work because the code reads (in plain English):
“Apply this style to all H1 elements that are descendants of an element (ancestor) with a class of noPadding”.