I'm attempting to center the <p>
element within the header, but it's consistently misaligned. I attempted placing it in a grid and consulted ChafGpt, but no solution worked.
I've also tried enclosing it in a container and applying "margin: 0 auto" to center it, however, it remains off-center. My goal is to have it perfectly centered, disregarding the logo, yet my efforts have been unsuccessful.
body {
background-color: grey;
}
header {
background-image: url('header.jpg');
background-size: cover;
background-position: center;
padding: 20px;
height: 10vh;
}
#logo {
display: flex;
max-width: 30%;
max-height: 100%;
float: left;
}
#page-description {
color: white;
padding: 15px 15px;
font-size: 30px;
margin: auto;
text-align: center;
}
<title>XboxPulse - News</title>
<link rel="stylesheet" href="News.css">
<script src="News.js"></script>
<header>
<img src="https://www.playourgames.nl/35770-medium_default/controller-wireless-xbox-pulse-red.jpg" alt="Xboxpulse" id="logo">
<p id="page-description">News</p>
</header>