you added the wrong pseudo-class, it works if it is only one pseudo-class for the parent: only-child should be assigned to the element itself that you want to change, and it is not necessary that paragraph P is the only, but generally the only element of the parent, even if you just add a DIV neighbor this paragraph you will not work pseudo class ...
.pbta p:only-child { font-size: 36px; color: orange; }
<div class="row pbta"> <div class="col-md-3"> <a class="recent" href=#> <img src="img/man_1.jpg" height="200" width="200" alt="JD"> <div class="info d-none"> <p>sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem.</p> </div> </a> <H5>Jonh Doeeh</H5> <p>Lead Designer</p> </div> </div>