CSS use is a 'Matching game'.
class="foo" is just a link
to the CSS entry .foo, where the actual styling is defined.
Define once, use Many is why CSS is so great. One place to change the looks of all places
class="foo" was used. One tiny change and
Bold can change to
Italic everyplace foo was used

The space between lines of code is for US HUMANS, it does not affect the render (if done right), Look at the line numbers on the Left there can be many lines of text (really big paragraph) and only 1 number. Again, the number is for US to locate when there is an error on line 42.