Place the html inside a PHP file and make the include, which will print everything in it. Basic example of user listing:
profileLayout.php (to perform include)
<img src='<?= $usuario['foto_perfil'] ?>'/>
<div class='nomeusuario'> <?= $usuario['nome'] ?> </div>
<div class='controles'>
<button>Seguir</button>
<button>Adicionar aos Amigos</button>
<button>Bloquear</button>
</div>
head.php (to perform include)
<link href="css/estilo.css" rel='stylesheet'/>
<script src="js/jquery.min.js" type='text/javascript'></script>
<script src="js/jquery-ui.min.js" type='text/javascript'></script>
index.php (source)
<html>
<head>
<?PHP include "head.php"; ?>
</head>
<body>
<?PHP
$usuarioLista = $banco->obterUsuarios();
foreach($usuarioLista as $usuario){
include "profileLayout.php";
}
?>
</body>
</html>
In this case you could reuse the head file to create a list of javascript files and style sheet in other pages of your system. The same for profileLayout.php that could provide you with a standard html to display cards on the users. That way you would not have to rewrite the same code several times.
But remember that in the end result, there will always be repeated divs in HTML. Just like an image (final product), you do not remove the pixels by being repeated.