タイトルには、h1とh2を中心に揃えようとしています。しかし、私がテキストを入力するたびに、align:center;それらを左に押すだけです。私はh1とh2の両方をスクリーンの中心に持っていたいと思います。私は手動で行うことができましたが、完全に中心にしたいと思っています。おかげで:)テキストアライメントセンターは、h1とh2のセンタリングテキストではありません
h1 {
position: absolute;
font-family: 'Passion One';
font-size: 50px;
color: #42E616;
letter-spacing: 1.6rem;
top: calc(80% - 200px);
text-align: center;
text-shadow: 2px 4px 3px rgba(0,0,0,0.6);
opacity: .68;
z-index: 2001;
}
h2 {
position: absolute;
font-family: 'Open Sans', monospace;
font-size: 12px;
color: black;
letter-spacing: .4rem ;
top: calc(58% - 30px);
text-align: center;
opacity: .68 ;
z-index: 2002;
}
<!DOCTYPE html>
<html>
<head>
<link href = "https://fonts.googleapis.com/css?family=Passion+One" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel = "stylesheet" href="Style.css">
<meta name = "viewport" content = "width = device-width, initial-scale=1">
<title> AL-SABA.net </title>
</head>
<header>
<h1> Title </h1>
<h2> Personal Website </h2>
</header>
</html>
うわー!ありがとう、これは完全に働いた。 –
@ルキー問題ありません! –