ul { list-style: none; } .pbta_text { font-size: 18px; } .pbta p:last-child { font-size: 13px; } .pbta p:only-child { text-align: center; font-size: 16px; } .recent { position: relative; display: inline-block; } .info { color: red; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(248,229,20,.9); } .info ul { position: absolute; margin: 0 auto; } .info li { display: inline-block; margin-right: 5px; } .recent:hover .info { display: block !important; } 
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"><link rel="stylesheet" href="css/main.css"> <div class="col-lg-3 col-md-6"> <div class="recent"> <img class="img-fluid" src="http://sunnyrio.beget.tech/img/man_1.jpg" alt="JD"> <div class="info d-none"> <p>sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem.</p> <ul> <li> <a href=#> <img src="http://sunnyrio.beget.tech/img/gplus.png"> </a> </li> <li> <a href=#> <img src="http://sunnyrio.beget.tech/img/gplus.png"> </a> </li> <li> <a href=#> <img src="http://sunnyrio.beget.tech/img/gplus.png"> </a> </li> </ul> </div> </div> <H5>Jonh Doeeh</H5> <p>Lead Designer</p> </div> 

enter image description here

    1 answer 1

    In .info ul add padding: 0; left: 50%; transform: translateX(-50%); padding: 0; left: 50%; transform: translateX(-50%); . In .info li remove margin. If it is needed, then do not add the last element.

     ul { list-style: none; } .recent { position: relative; display: inline-block; } .info { color: red; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(248,229,20,.9); } .info ul { position: absolute; padding: 0; left: 50%; transform: translateX(-50%); } .info li { display: inline-block; } .info a { text-decoration: none; } 
     <div class="col-lg-3 col-md-6"> <div class="recent"> <img class="img-fluid" src="http://sunnyrio.beget.tech/img/man_1.jpg" alt="JD"> <div class="info d-none"> <p>sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem.</p> <ul> <li> <a href=#> <img src="http://sunnyrio.beget.tech/img/gplus.png"> </a> </li> <li> <a href=#> <img src="http://sunnyrio.beget.tech/img/gplus.png"> </a> </li> <li> <a href=#> <img src="http://sunnyrio.beget.tech/img/gplus.png"> </a> </li> </ul> </div> </div> </div> 

    • Why do I have the last element in your version to be transferred to a new line, down in general ??? - sunnyrio
    • you can see on the site sunnyrio.beget.tech - sunnyrio
    • You can rest here on habrahabr.ru/post/137582 . It explains why and how you can decide. - Kniha m