I was reading about the difference between ID and class selectors where it says
"Each page can have only one element with that ID"
Though, How the #one managed to select both HTML elements.
#one {
  color: blue;
}<div>
  <p id="one"> blue</p>
  <h1 id="one"> H1</h1>
</div>Result run on chrome browser: both elements are displayed with blue color .
 
     
    