<div class="ghost-center"> <p>Nous sommes plusieurs lignes de texte centrées (avec un pseudo-élément fantôme) verticalement dans un containeur.</p> </div>
body { background: #3e58aa; font-size: 80%; } div { background: white; width: 240px; height: 200px; margin: 20px; color: #3e58aa; resize: vertical; overflow: auto; padding: 20px; } .ghost-center { position: relative; } .ghost-center::before { content: " "; display: inline-block; height: 100%; width: 1%; vertical-align: middle; } .ghost-center p { display: inline-block; vertical-align: middle; width: 190px; margin: 0; padding: 20px; background: #CCDCCD; }