title: CSS: are class and id interchangeable?
body: <p>I know others have asked about using class and id in CSS files, such as</p>
  
  <p><a href="https://stackoverflow.com/questions/84378/div-class-vs-id">Div: Class vs Id</a></p>
  
  <p>So I'm aware of the semantic and syntactic differences between class and id: that id should be used for elements that are used only once and class should be used for elements that share attributes in common. </p>
  
  <p>But this isn't a hard-and-fast rule, is it? What's the harm in using an id for more than one element? Or using a class for only one? After all, isn't "one element" just a set (class) with only one thing in it?</p>
  
  <p>Will the browser's CSS interpreter throw an error if I break the rules? I haven't seen it happen.</p>
  
  <p>So why do we have both id and class? Why not just one one or the other and call it good?</p>