For full screen width headers and footers, simply set the width to 100% like this:
header,footer {
width:100%
}
To center align any element with ease, you can utilize flexbox as shown below:
header {
background: #aaf;
display: flex;
justify-content: center;
}
footer {
background: #aff;
display: flex;
justify-content: center;
}
header div.logo {
display: flex;
justify-content: center;
}
footer ul.social {
width : 100%;
list-style: none;
display: flex;
justify-content: space-evenly;
}
In order to center the content of child elements in Header and Footer (h1 and li), you need to use flex again. Adjusting the ul width allows space-evenly
to look centered.
If you have any more queries, feel free to drop a comment.
body {
background: rgb(36, 36, 33);
margin: 0;
padding: 0;
height: 100vh;
}
header,
footer {
width: 100%
}
header {
background: #aaf;
display: flex;
justify-content: center;
}
footer {
background: #aff;
display: flex;
justify-content: center;
}
header div.logo {
display: flex;
justify-content: center;
}
header div.logo > *{
padding: 0 10px;
}
footer ul.social {
width : 100%;
list-style: none;
display: flex;
justify-content: space-evenly;
}
<!Doctype HTML>
<html lang="en">
<head>
<meta charset="UTF-8>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<title></title>
</head>
<body>
<header>
<div class="logo">
<h1>actual image logo here</h1>
<h1>The ABC Company</h1>
</div>
</header>
<footer>
<ul class="social">
<li class="social_icon">Twitter Logo here</li>
<li class="social_icon">Facebook logo here</i></li>
<li class="social_icon">Insta logo here</li>
</ul>
</footer>
</body>
</html>