Edit in JSFiddle

.test h1 + h1 + h1{
  color: red;
}

.test h1~p{
  color: blue;
}
<div class="test">
 <h1>
 this is one
 </h1>
 <h1>
 this is two
 </h1>
 <h1>
 this is three
 </h1>
 <p>
   this is first p tag
 </p>
 </div>