Could not align p tag vertically centered using Flex

<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="style.css">
  <div class="sound">
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates at porro, veritatis adipisci sapiente laudantium accusantium repellendus aspernatur beatae omnis optio quasi quibusdam eligendi laborum animi sed deleniti magni tenetur.</p>

This used to be magic as per my memory, but could not align the p tag vertically centered.

.sound {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;

What mistake am I doing?

1 Like

height: 100vh;


This is what i got from your question. You want to align the text vertically right so here’s solution for it

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.