Sorry if this is something obvious, but I've searched the internet far and wide, and couldn't find anybody with the same problem as me. I've just recently started learning HTML and CSS and am trying to vertically align the text on my website. justify-content works, but align-items does not.
I just need someone to point me in the right direction, this has left me completely hopeless.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
</head>
<body>
<style>
.center {
display: flex;
justify-content: center;
align-items: center;
}
body {
background-image: linear-gradient(to right, #432371, #9f6976);
}
.text {
font-family: "Open Sans";
color: white;
font-size: 50px;
}
.link1 {
color: white;
font-family: "Open Sans";
font-size: 20px;
}
.link2 {
color: white;
font-family: "Open Sans";
font-size: 20px;
}
</style>
<h1 class="center text">Coming Soon.</h1>
<a class="link1 center" href="https://google.com">Link1</a>
<a class="link2 center" href="https://google.com">Link2</a>
</body>
</html>
Thanks in advance.