title: Why is my class selector not overriding tag selector?
body: <p>So I've been coding for a week and I have googled for 30 min trying to find a solution. So excuse me if it's already been asked. I'm trying to write a summary of what I've learned after each lesson but it's not working!</p>
  
  <pre><code>&lt;body&gt; &lt;center&gt; h1&gt; Module 40 &lt;/h1&gt; &lt;/center&gt;
  
  
  &lt;p&gt;In this module I have learned on how to use the tag &lt;!-- &lt;div&gt; ---&gt; the purpose of this tag is to create a specific group whether it is images, headers, paragraphs, etc, which you can attribute seperate properties to so it is unaffected by tag selectors. by adding a class or ID to it. &lt;/p&gt; &lt;br&gt;
  
  &lt;div class="p1"&gt;
  
   &lt;p&gt; Like for example this paragraph is inside a div called "p1". And I have added a specific font-size for this one compared to the previous paragraph which is affected by a &lt;strong&gt; tag &lt;/strong&gt; selector instead of a &lt;strong&gt; class &lt;/strong&gt; selector.
  &lt;/p&gt;
  
  &lt;/div&gt; 
  
  &lt;/body&gt;
  </code></pre>
  
  <p>And my CSS is this:</p>
  
  <pre><code>p
  {
  font-size: 15px;  
  }
  
  /*****class selector*****/
  .p1
  {
  font-size: 20px;  
  }
  </code></pre>
  
  <p>Shouldn't the class selector override the tag selector? Font size 15px is being applied to the whole text. It works if I add class="p1" to the second paragraph. But shouldn't this work if I add it to the div? Isn't that the purpose of having a div?</p>