Footer taking up alot of blank space when at the bottom of page [duplicate] - html

This question already has answers here:
Footer at bottom of page or content, whichever is lower
(5 answers)
Closed last year.
I'm trying to make a website where I have a footer at the bottom of the page. I found another solution on how to place the footer at the bottom of the page online which worked amazing with no problems.
But when I tried making the website responsive I recognized that for some reason the footer took up a lot of space which created a lot of blank space between the main content and the footer. I've tried to remove the blank space, but that just results in a bunch of other problems.
Preferably I would want to remove the blank space and have the footer right under the main content of the page. Any help or advice would be appreciated!
* {
box-sizing: border-box;
}
body {
font-family: Arial;
display: flex;
flex-direction: column;
height: 100vh;
margin: 0;
}
.container {
width: 100%;
border: 1px solid gray;
background-color: rgb(255, 255, 255);
border-bottom: 0px;
}
#font-face {
font-family: Gemosh;
src: url(Gemosh2.otf);
}
header {
font-family: Gemosh;
padding: 1em;
color: black;
background-image: url(header.jpg);
background-size: cover;
text-align: center;
letter-spacing: 1em;
}
header h1 {
margin-top: 5%;
font-size: 60px;
}
footer {
padding: 1em;
color: white;
background-color: black;
text-align: center;
font-size: 15px;
}
.navbar {
display: flex;
margin-bottom: 0px;
justify-content: center;
justify-content: space-evenly;
padding: 1em;
padding-bottom: 1em;
padding-top: 0em;
}
.dropdown {
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: center;
position: relative;
color: white;
text-decoration: none;
padding: 1.5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
background-color: #444444 !important;
border-radius: 5px;
font-size: 15px;
transition: 0.2s;
}
.dropdown a {
display: block;
color: white;
text-decoration: none;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-radius: 5px;
transition: 0.2s;
text-align: center;
}
.dropdown>.dropdown-sub {
display: none;
z-index: 1;
flex-direction: column;
position: absolute;
top: 35px;
background: #636363;
color: white;
border-radius: 5px;
transition: 0.2s;
width: 100%;
right: 0px;
}
.dropdown:hover>.dropdown-sub {
display: flex;
}
.dropdown-option:hover {
background-color: #abcdef !important;
color: white;
}
.active-dropdown {
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: center;
position: relative;
color: white;
text-decoration: none;
padding: 1.5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
background-color: #04AA6D !important;
border-radius: 5px;
font-size: 15px;
transition: 0.2s;
}
.active-dropdown a {
display: block;
background-color: #11c784 !important;
color: white;
text-decoration: none;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-radius: 5px;
transition: 0.2s;
text-align: center;
}
.active-dropdown>.dropdown-sub {
display: none;
z-index: 1;
flex-direction: column;
position: absolute;
top: 35px;
background: rgb(4, 199, 129);
color: white;
border-radius: 5px;
transition: 0.2s;
width: 100%;
right: 0px;
}
.active-dropdown:hover>.dropdown-sub {
display: flex;
}
.dropdown-option a:hover {
background-color: #abcdef !important;
color: white;
}
.main {
padding: 1em;
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.test {
display: flex;
flex-direction: row;
justify-content: space-evenly;
font-size: 50px;
padding: 10px;
}
.londontxt {
flex: 20%;
padding: 2em;
font-size: 15px;
padding-bottom: 0em;
padding-top: 0em;
}
.pic {
flex: 20%;
padding: 10px;
}
.pic img {
margin-left: 10%;
width: 80%;
}
.pic h2 {
margin-left: 10%;
}
#media only screen and (min-width: 600px) {
.londontxt {
padding: 3em;
padding-bottom: 0em;
padding-top: 0em;
}
}
#media only screen and (min-width: 680px) {
.londontxt {
padding: 4em;
padding-bottom: 0em;
padding-top: 0em;
font-size: 20px;
}
}
#media only screen and (min-width: 821px) {
header {
display: block;
font-family: Gemosh;
padding: 1em;
color: black;
background-image: url(header.jpg);
background-size: cover;
text-align: center;
height: 350px;
letter-spacing: 1em;
}
header h1 {
margin-top: 5%;
font-size: 120px;
}
.navbar {
justify-content: center;
gap: 50px;
padding: 1em;
padding-bottom: 4em;
padding-top: 1.5em;
}
.navbar a {
padding: 2em;
padding-top: 1em;
padding-bottom: 1em;
transition: 0.2s;
}
.dropdown {
padding: 2em;
padding-top: 1em;
padding-bottom: 1em;
}
.dropdown a {
background-color: #636363 !important;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
text-align: center;
}
.dropdown>.dropdown-sub {
top: 40px;
}
.dropdown-option a:hover {
color: white;
}
.active-dropdown {
padding: 1.8em;
padding-top: 1em;
padding-bottom: 1em;
}
.active-dropdown a {
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
.active-dropdown>.dropdown-sub {
top: 40px;
}
.main {
flex-direction: row;
}
.londontxt {
font-size: 15px;
padding: 1em;
}
}
#media only screen and (min-width: 1000px) {
.londontxt {
font-size: 20px;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>City</title>
<link href="london.css" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width">
</head>
<body>
<div class="container">
<header>
<h1>City Gallery</h1>
</header>
<div class="navbar">
<div class="active-dropdown">
<div class="dropdown-title">London</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
<div class="dropdown">
<div class="dropdown-title">Paris</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
<div class="dropdown">
<div class="dropdown-title">Tokyo</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
</div>
<div class="main">
<div class="londontxt">
<h2>London</h2>
<p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>
<p>Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.</p>
</div>
<div class="pic">
<h2>Tower Bridge:</h2>
<img src="londonbridge.jpg" alt="">
</div>
<div class="pic">
<h2>Big Ben:</h2>
<img src="londonbigben.jpg" alt="">
</div>
</div>
</div>
<footer>Copyright © 2022 Johannes</footer>
</body>
</html>

The best solution would be to remove the flex from the body element & instead set the flex properties on the container. With your current structure, you can fix this by adding the following CSS to footer.
footer {
width: 100vw;
position: fixed;
bottom: 0;
}
* {
box-sizing: border-box;
}
body {
font-family: Arial;
display: flex;
flex-direction: column;
height: 100vh;
margin: 0;
}
.container {
width: 100%;
border: 1px solid gray;
background-color: rgb(255, 255, 255);
border-bottom: 0px;
}
#font-face {
font-family: Gemosh;
src: url(Gemosh2.otf);
}
header {
font-family: Gemosh;
padding: 1em;
color: black;
background-image: url(header.jpg);
background-size: cover;
text-align: center;
letter-spacing: 1em;
}
header h1 {
margin-top: 5%;
font-size: 60px;
}
footer {
padding: 1em;
color: white;
background-color: black;
text-align: center;
font-size: 15px;
position: fixed;
width: 100vw;
bottom: 0;
}
.navbar {
display: flex;
margin-bottom: 0px;
justify-content: center;
justify-content: space-evenly;
padding: 1em;
padding-bottom: 1em;
padding-top: 0em;
}
.dropdown {
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: center;
position: relative;
color: white;
text-decoration: none;
padding: 1.5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
background-color: #444444 !important;
border-radius: 5px;
font-size: 15px;
transition: 0.2s;
}
.dropdown a {
display: block;
color: white;
text-decoration: none;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-radius: 5px;
transition: 0.2s;
text-align: center;
}
.dropdown>.dropdown-sub {
display: none;
z-index: 1;
flex-direction: column;
position: absolute;
top: 35px;
background: #636363;
color: white;
border-radius: 5px;
transition: 0.2s;
width: 100%;
right: 0px;
}
.dropdown:hover>.dropdown-sub {
display: flex;
}
.dropdown-option:hover {
background-color: #abcdef !important;
color: white;
}
.active-dropdown {
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: center;
position: relative;
color: white;
text-decoration: none;
padding: 1.5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
background-color: #04AA6D !important;
border-radius: 5px;
font-size: 15px;
transition: 0.2s;
}
.active-dropdown a {
display: block;
background-color: #11c784 !important;
color: white;
text-decoration: none;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-radius: 5px;
transition: 0.2s;
text-align: center;
}
.active-dropdown>.dropdown-sub {
display: none;
z-index: 1;
flex-direction: column;
position: absolute;
top: 35px;
background: rgb(4, 199, 129);
color: white;
border-radius: 5px;
transition: 0.2s;
width: 100%;
right: 0px;
}
.active-dropdown:hover>.dropdown-sub {
display: flex;
}
.dropdown-option a:hover {
background-color: #abcdef !important;
color: white;
}
.main {
padding: 1em;
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.test {
display: flex;
flex-direction: row;
justify-content: space-evenly;
font-size: 50px;
padding: 10px;
}
.londontxt {
flex: 20%;
padding: 2em;
font-size: 15px;
padding-bottom: 0em;
padding-top: 0em;
}
.pic {
flex: 20%;
padding: 10px;
}
.pic img {
margin-left: 10%;
width: 80%;
}
.pic h2 {
margin-left: 10%;
}
#media only screen and (min-width: 600px) {
.londontxt {
padding: 3em;
padding-bottom: 0em;
padding-top: 0em;
}
}
#media only screen and (min-width: 680px) {
.londontxt {
padding: 4em;
padding-bottom: 0em;
padding-top: 0em;
font-size: 20px;
}
}
#media only screen and (min-width: 821px) {
header {
display: block;
font-family: Gemosh;
padding: 1em;
color: black;
background-image: url(header.jpg);
background-size: cover;
text-align: center;
height: 350px;
letter-spacing: 1em;
}
header h1 {
margin-top: 5%;
font-size: 120px;
}
.navbar {
justify-content: center;
gap: 50px;
padding: 1em;
padding-bottom: 4em;
padding-top: 1.5em;
}
.navbar a {
padding: 2em;
padding-top: 1em;
padding-bottom: 1em;
transition: 0.2s;
}
.dropdown {
padding: 2em;
padding-top: 1em;
padding-bottom: 1em;
}
.dropdown a {
background-color: #636363 !important;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
text-align: center;
}
.dropdown>.dropdown-sub {
top: 40px;
}
.dropdown-option a:hover {
color: white;
}
.active-dropdown {
padding: 1.8em;
padding-top: 1em;
padding-bottom: 1em;
}
.active-dropdown a {
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
.active-dropdown>.dropdown-sub {
top: 40px;
}
.main {
flex-direction: row;
}
.londontxt {
font-size: 15px;
padding: 1em;
}
}
#media only screen and (min-width: 1000px) {
.londontxt {
font-size: 20px;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>City</title>
<link href="london.css" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width">
</head>
<body>
<div class="container">
<header>
<h1>City Gallery</h1>
</header>
<div class="navbar">
<div class="active-dropdown">
<div class="dropdown-title">London</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
<div class="dropdown">
<div class="dropdown-title">Paris</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
<div class="dropdown">
<div class="dropdown-title">Tokyo</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
</div>
<div class="main">
<div class="londontxt">
<h2>London</h2>
<p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>
<p>Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.</p>
</div>
<div class="pic">
<h2>Tower Bridge:</h2>
<img src="londonbridge.jpg" alt="">
</div>
<div class="pic">
<h2>Big Ben:</h2>
<img src="londonbigben.jpg" alt="">
</div>
</div>
</div>
<footer>Copyright © 2022 Johannes</footer>
</body>
</html
EDIT ~ OP want's container to be 100vh, use position: fixed; instead.

You can add this code to .pic:last-child:
.pic:last-child {
margin-bottom: -70px;
}
* {
box-sizing: border-box;
}
body {
font-family: Arial;
display: flex;
flex-direction: column;
height: 100vh;
margin: 0;
}
.container {
width: 100%;
border: 1px solid gray;
background-color: rgb(255, 255, 255);
border-bottom: 0px;
}
#font-face {
font-family: Gemosh;
src: url(Gemosh2.otf);
}
header {
font-family: Gemosh;
padding: 1em;
color: black;
background-image: url(header.jpg);
background-size: cover;
text-align: center;
letter-spacing: 1em;
}
header h1 {
margin-top: 5%;
font-size: 60px;
}
footer {
padding: 1em;
color: white;
background-color: black;
text-align: center;
font-size: 15px;
}
.navbar {
display: flex;
margin-bottom: 0px;
justify-content: center;
justify-content: space-evenly;
padding: 1em;
padding-bottom: 1em;
padding-top: 0em;
}
.dropdown {
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: center;
position: relative;
color: white;
text-decoration: none;
padding: 1.5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
background-color: #444444 !important;
border-radius: 5px;
font-size: 15px;
transition: 0.2s;
}
.dropdown a {
display: block;
color: white;
text-decoration: none;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-radius: 5px;
transition: 0.2s;
text-align: center;
}
.dropdown>.dropdown-sub {
display: none;
z-index: 1;
flex-direction: column;
position: absolute;
top: 35px;
background: #636363;
color: white;
border-radius: 5px;
transition: 0.2s;
width: 100%;
right: 0px;
}
.dropdown:hover>.dropdown-sub {
display: flex;
}
.dropdown-option:hover {
background-color: #abcdef !important;
color: white;
}
.active-dropdown {
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: center;
position: relative;
color: white;
text-decoration: none;
padding: 1.5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
background-color: #04AA6D !important;
border-radius: 5px;
font-size: 15px;
transition: 0.2s;
}
.active-dropdown a {
display: block;
background-color: #11c784 !important;
color: white;
text-decoration: none;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-radius: 5px;
transition: 0.2s;
text-align: center;
}
.active-dropdown>.dropdown-sub {
display: none;
z-index: 1;
flex-direction: column;
position: absolute;
top: 35px;
background: rgb(4, 199, 129);
color: white;
border-radius: 5px;
transition: 0.2s;
width: 100%;
right: 0px;
}
.active-dropdown:hover>.dropdown-sub {
display: flex;
}
.dropdown-option a:hover {
background-color: #abcdef !important;
color: white;
}
.main {
padding: 1em;
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.test {
display: flex;
flex-direction: row;
justify-content: space-evenly;
font-size: 50px;
padding: 10px;
}
.londontxt {
flex: 20%;
padding: 2em;
font-size: 15px;
padding-bottom: 0em;
padding-top: 0em;
}
.pic {
flex: 20%;
padding: 10px;
}
.pic:last-child {
margin-bottom: -70px;
}
.pic img {
margin-left: 10%;
width: 80%;
}
.pic h2 {
margin-left: 10%;
}
#media only screen and (min-width: 600px) {
.londontxt {
padding: 3em;
padding-bottom: 0em;
padding-top: 0em;
}
}
#media only screen and (min-width: 680px) {
.londontxt {
padding: 4em;
padding-bottom: 0em;
padding-top: 0em;
font-size: 20px;
}
}
#media only screen and (min-width: 821px) {
header {
display: block;
font-family: Gemosh;
padding: 1em;
color: black;
background-image: url(header.jpg);
background-size: cover;
text-align: center;
height: 350px;
letter-spacing: 1em;
}
header h1 {
margin-top: 5%;
font-size: 120px;
}
.navbar {
justify-content: center;
gap: 50px;
padding: 1em;
padding-bottom: 4em;
padding-top: 1.5em;
}
.navbar a {
padding: 2em;
padding-top: 1em;
padding-bottom: 1em;
transition: 0.2s;
}
.dropdown {
padding: 2em;
padding-top: 1em;
padding-bottom: 1em;
}
.dropdown a {
background-color: #636363 !important;
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
text-align: center;
}
.dropdown>.dropdown-sub {
top: 40px;
}
.dropdown-option a:hover {
color: white;
}
.active-dropdown {
padding: 1.8em;
padding-top: 1em;
padding-bottom: 1em;
}
.active-dropdown a {
padding: 0em;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
.active-dropdown>.dropdown-sub {
top: 40px;
}
.main {
flex-direction: row;
}
.londontxt {
font-size: 15px;
padding: 1em;
}
}
#media only screen and (min-width: 1000px) {
.londontxt {
font-size: 20px;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>City</title>
<link href="london.css" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width">
</head>
<body>
<div class="container">
<header>
<h1>City Gallery</h1>
</header>
<div class="navbar">
<div class="active-dropdown">
<div class="dropdown-title">London</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
<div class="dropdown">
<div class="dropdown-title">Paris</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
<div class="dropdown">
<div class="dropdown-title">Tokyo</div>
<div class="dropdown-sub">
<div class="dropdown-option">Overview</div>
<div class="dropdown-option">Wikipedia</div>
<div class="dropdown-option">Pictures</div>
</div>
</div>
</div>
<div class="main">
<div class="londontxt">
<h2>London</h2>
<p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>
<p>Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.</p>
</div>
<div class="pic">
<h2>Tower Bridge:</h2>
<img src="londonbridge.jpg" alt="">
</div>
<div class="pic">
<h2>Big Ben:</h2>
<img src="londonbigben.jpg" alt="">
</div>
</div>
</div>
<footer>Copyright © 2022 Johannes</footer>
</body>
</html>

Related

Footer and Form appearing into each other

While developing my website I have came across a problem with my footer and form. My footer seems to be appearing through the form on devices but not on the computer and I'm sure this could be issues with widths of devices? So I kept trying to fix it and still haven't been able to fix it. I'm still learning as I go along and I would be grateful if someone could help me get rolling with my website again. code snippets and images below, kindest regards, Caelan.
body {
background-color: black ;
}
/* Announcment bar */
.alert {
padding: 20px;
background-color: #2a7a85;
color: white;
}
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}
.closebtn:hover {
color: black;
}
body {
margin: 0;
}
/* Navigation bar */
ul.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgb(248, 248, 248);
}
ul.topnav li {
float: left;
}
ul.topnav li a {
display: block;
color: black;
text-align: center;
font-weight: bold;
padding: 25px 32px;
text-decoration: none;
}
ul.topnav li a:hover:not(.active) {
background-color: rgb(55, 81, 165);
}
ul.topnav li a.active {
background-color: #0cc0d8;
}
ul.topnav li.right {
float: right;
}
#media screen and (max-width: 600px) {
ul.topnav li.right,
ul.topnav li {
float: none;
}
}
/* On smaller screens, decrease text size */
#media only screen and (max-width: 300px) {
.text {
font-size: 11px;
}
}
/* Homepage button */
.glow-on-hover {
width: 220px;
height: 35px;
border: none;
outline: none;
color: rgb(0, 0, 0);
font-weight: bold;
font-size: 20px;
background: #111;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
}
.glow-on-hover:before {
content: '';
background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
position: absolute;
top: -2px;
left:-2px;
background-size: 400%;
z-index: -1;
filter: blur(5px);
width: calc(100% + 4px);
height: calc(100% + 4px);
animation: glowing 20s linear infinite;
opacity: 0;
transition: opacity .3s ease-in-out;
border-radius: 10px;
}
.glow-on-hover:active {
color: #000
}
.glow-on-hover:active:after {
background: transparent;
}
.glow-on-hover:hover:before {
opacity: 1;
}
.glow-on-hover:after {
z-index: -1;
content: '';
position: absolute;
width: 100%;
height: 100%;
background: rgb(11, 78, 223);
left: 0;
top: 0;
border-radius: 10px;
}
#keyframes glowing {
0% { background-position: 0 0; }
50% { background-position: 400% 0; }
100% { background-position: 0 0; }
}
/* kipplo heading on homepage */
h1 {
font-size: 10vw;
margin: 0;
padding: 0;
font-family: 'Courier New', Courier, monospace;
color: blue;
word-wrap: break-word;
text-align: center;
}
/* for the heading and the button alignment*/
.container {
display: flex;
flex-direction: column;
height: 100vh;
}
.btn-centering {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* product cards*/
h3{
text-align: center;
font-size: 30px;
margin: 0;
padding-top: 10px;
}
a{
text-decoration: none;
}
.gallery{
display: flex;
flex-wrap: wrap;
width: 100%;
justify-content: center;
align-items: center;
margin: 50px 0;
}
.content{
width: 24%;
margin: 15px;
box-sizing: border-box;
float: left;
text-align: center;
border-radius:10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-top: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
transition: .4s;
background-color: whitesmoke;
}
.content:hover{
box-shadow: 0 0 11px rgb(0, 217, 255);
transform: translate(0px, -8px);
transition: .6s;
}
.productcard-image{
width: 200px;
height: 200px;
text-align: center;
margin: 0 auto;
display: block;
}
p{
text-align: center;
color: #b2bec3;
padding: 0 8px;
}
h6{
font-size: 26px;
text-align: center;
color: #222f3e;
margin: 0;
}
.product-card{
list-style-type: none;
display: flex;
justify-content: center;
align-items: center;
padding: 0px;
}
.productcard-list{
padding: 5px;
}
.fa{
color: #ff9f43;
font-size: 26px;
transition: .4s;
}
.fa:hover{
transform: scale(1.3);
transition: .6s;
}
.productcardbutton{
text-align: center;
font-size: 24px;
color: #fff;
width: 100%;
padding: 15px;
border:0px;
outline: none;
cursor: pointer;
margin-top: 5px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.buy-1{
background-color: #2183a2;
}
.buy-2{
background-color: #3b3e6e;
}
.buy-3{
background-color: #0b0b0b;
}
#media(max-width: 1000px){
.content{
width: 46%;
}
}
#media(max-width: 750px){
.content{
width: 100%;
}
}
/* Footer */
.footer__container {
background-color: #141414;
padding: 5rem 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#footer__logo {
color: #fff;
display: flex;
align-items: center;
cursor: pointer;
text-decoration: none;
font-size: 2rem;
}
.footer__links {
width: 100%;
max-width: 1000px;
display: flex;
justify-content: center;
}
.footer__link--wrapper {
display: flex;
}
.footer__link--items {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 16px;
text-align: left;
width: 160px;
box-sizing: border-box;
}
.footer__link--items h2 {
margin-bottom: 16px;
}
.footer__link--items > h2 {
color: #fff;
}
.footer__link--items a {
color: #fff;
text-decoration: none;
margin-bottom: 0.5rem;
}
.footer__link--items a:hover {
color: #e9e9e9;
transition: 0.3s ease-out;
}
/* Social Icons */
.social__icon--link {
color: #fff;
font-size: 24px;
}
.social__media {
max-width: 1000px;
width: 100%;
}
.social__media--wrap {
display: flex;
justify-content: space-between;
align-items: center;
width: 90%;
max-width: 1000px;
margin: 40px auto 0 auto;
}
.website__rights {
color: #fff;
}
#media screen and (max-width: 820px) {
.footer__links {
padding-top: 2rem;
}
#footer__logo {
margin-bottom: 2rem;
}
.website__rights {
padding: 2rem;
}
.footer__link--wrapper {
flex-direction: column;
}
.social__media--wrap {
flex-direction: column;
}
}
#media screen and (max-width: 480px) {
.footer__link--items {
margin: 0;
padding: 10px;
width: 100%;
}
}
/* Text above the form*/
/* Feedback form*/
.form1 {
display: flex;
flex-direction: column;
align-items: center;
width: 500px;
margin: 15vh auto;
margin-bottom: -60vh;
border-radius: 15px;
border: none;
box-shadow: 0 0 15px rgb(24, 143, 190);
}
form {
display: flex;
flex-direction: column;
align-items: center;
width: 90%;
}
input {
width: 100%;
margin: 5px 0;
height: 35px;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
textarea {
width: 100%;
margin: 5px 0;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
input[type=submit]{
margin: 10px auto;
width: 120px;
background: rgb(24, 143, 190);
color: white;
cursor: pointer;
}
input[type=submit]:hover{
background: rgb(19, 41, 238);
}
#media screen and (max-width:600px) {
.form1{
width: 90%;
}
}
h2 {
color: #00ffd5;
font-size: 30px;
}
p4 {
color: #00ffd5;
font-size: 20px;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="img/icon.png" />
<link rel="stylesheet" href="styles.css" />
<title>Contact Us</title>
</head>
<body>
<!-- Alert bar -->
<div class="container">
<div class="alert">
<span
class="closebtn"
onclick="this.parentElement.style.display='none';"
>×</span>
<center>
<strong>DEALS NOW ON!</strong> Upto 30% discounts this
christmas
</center>
</div>
<!-- Navigation bar -->
<ul class="topnav">
<li><img src="img/logo.png" /></li>
<li>Home</li>
<li>Products</li>
<li><a class="active" href="contactus.html">Contact Us</a></li>
<li class="right">About Us</li>
</ul>
<!-- Form -->
<div class="form1">
<h2>Contact Us!</h2>
<p4>Typical Replies Within 24hrs!</p4>
<br>
<form action="">
<input type="email" name="email" id="email" placeholder="Enter your email">
<input type="text" name="name" id="name" placeholder=" Enter your name">
<textarea name="message" id="message" cols="30" rows="10" placeholder="Enter your message here"></textarea>
<input type="submit" value="Send">
</form>
</div>
</div>
<!-- Footer -->
<div class="footer__container">
<div class="footer__links">
<div class="footer__link--wrapper">
<div class="footer__link--items">
About Us
</div>
<div class="footer__link--items">
Contact Us
</div>
</div>
<div class="footer__link--wrapper">
<div class="footer__link--items">
Youtube
</div>
<div class="footer__link--items">
TikTok
</div>
</div>
</div>
<section class="social__media">
<div class="social__media--wrap">
<div class="footer__logo">
<a href="index.html">
<img src="img/logo2.png" id="footer__logo" ></a>
</div>
<p class="website__rights">© KIPPLO.CO.UK PROTOTYPE 2022. All rights reserved</p>
<div class="social__icons">
</div>
</div>
</section>
</div>
</body>
</html>
I've adjusted the css to remove the height and margin on the containers:
body {
background-color: black;
}
/* Announcment bar */
.alert {
padding: 20px;
background-color: #2a7a85;
color: white;
}
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}
.closebtn:hover {
color: black;
}
body {
margin: 0;
}
/* Navigation bar */
ul.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgb(248, 248, 248);
}
ul.topnav li {
float: left;
}
ul.topnav li a {
display: block;
color: black;
text-align: center;
font-weight: bold;
padding: 25px 32px;
text-decoration: none;
}
ul.topnav li a:hover:not(.active) {
background-color: rgb(55, 81, 165);
}
ul.topnav li a.active {
background-color: #0cc0d8;
}
ul.topnav li.right {
float: right;
}
#media screen and (max-width: 600px) {
ul.topnav li.right,
ul.topnav li {
float: none;
}
}
/* On smaller screens, decrease text size */
#media only screen and (max-width: 300px) {
.text {
font-size: 11px;
}
}
/* Homepage button */
.glow-on-hover {
width: 220px;
height: 35px;
border: none;
outline: none;
color: rgb(0, 0, 0);
font-weight: bold;
font-size: 20px;
background: #111;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
}
.glow-on-hover:before {
content: "";
background: linear-gradient(
45deg,
#ff0000,
#ff7300,
#fffb00,
#48ff00,
#00ffd5,
#002bff,
#7a00ff,
#ff00c8,
#ff0000
);
position: absolute;
top: -2px;
left: -2px;
background-size: 400%;
z-index: -1;
filter: blur(5px);
width: calc(100% + 4px);
height: calc(100% + 4px);
animation: glowing 20s linear infinite;
opacity: 0;
transition: opacity 0.3s ease-in-out;
border-radius: 10px;
}
.glow-on-hover:active {
color: #000;
}
.glow-on-hover:active:after {
background: transparent;
}
.glow-on-hover:hover:before {
opacity: 1;
}
.glow-on-hover:after {
z-index: -1;
content: "";
position: absolute;
width: 100%;
height: 100%;
background: rgb(11, 78, 223);
left: 0;
top: 0;
border-radius: 10px;
}
#keyframes glowing {
0% {
background-position: 0 0;
}
50% {
background-position: 400% 0;
}
100% {
background-position: 0 0;
}
}
/* kipplo heading on homepage */
h1 {
font-size: 10vw;
margin: 0;
padding: 0;
font-family: "Courier New", Courier, monospace;
color: blue;
word-wrap: break-word;
text-align: center;
}
/* for the heading and the button alignment*/
.container {
display: flex;
flex-direction: column;
}
.btn-centering {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* product cards*/
h3 {
text-align: center;
font-size: 30px;
margin: 0;
padding-top: 10px;
}
a {
text-decoration: none;
}
.gallery {
display: flex;
flex-wrap: wrap;
width: 100%;
justify-content: center;
align-items: center;
margin: 50px 0;
}
.content {
width: 24%;
margin: 15px;
box-sizing: border-box;
float: left;
text-align: center;
border-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-top: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
transition: 0.4s;
background-color: whitesmoke;
}
.content:hover {
box-shadow: 0 0 11px rgb(0, 217, 255);
transform: translate(0px, -8px);
transition: 0.6s;
}
.productcard-image {
width: 200px;
height: 200px;
text-align: center;
margin: 0 auto;
display: block;
}
p {
text-align: center;
color: #b2bec3;
padding: 0 8px;
}
h6 {
font-size: 26px;
text-align: center;
color: #222f3e;
margin: 0;
}
.product-card {
list-style-type: none;
display: flex;
justify-content: center;
align-items: center;
padding: 0px;
}
.productcard-list {
padding: 5px;
}
.fa {
color: #ff9f43;
font-size: 26px;
transition: 0.4s;
}
.fa:hover {
transform: scale(1.3);
transition: 0.6s;
}
.productcardbutton {
text-align: center;
font-size: 24px;
color: #fff;
width: 100%;
padding: 15px;
border: 0px;
outline: none;
cursor: pointer;
margin-top: 5px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.buy-1 {
background-color: #2183a2;
}
.buy-2 {
background-color: #3b3e6e;
}
.buy-3 {
background-color: #0b0b0b;
}
#media (max-width: 1000px) {
.content {
width: 46%;
}
}
#media (max-width: 750px) {
.content {
width: 100%;
}
}
/* Footer */
.footer__container {
background-color: #141414;
padding: 5rem 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#footer__logo {
color: #fff;
display: flex;
align-items: center;
cursor: pointer;
text-decoration: none;
font-size: 2rem;
}
.footer__links {
width: 100%;
max-width: 1000px;
display: flex;
justify-content: center;
}
.footer__link--wrapper {
display: flex;
}
.footer__link--items {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 16px;
text-align: left;
width: 160px;
box-sizing: border-box;
}
.footer__link--items h2 {
margin-bottom: 16px;
}
.footer__link--items > h2 {
color: #fff;
}
.footer__link--items a {
color: #fff;
text-decoration: none;
margin-bottom: 0.5rem;
}
.footer__link--items a:hover {
color: #e9e9e9;
transition: 0.3s ease-out;
}
/* Social Icons */
.social__icon--link {
color: #fff;
font-size: 24px;
}
.social__media {
max-width: 1000px;
width: 100%;
}
.social__media--wrap {
display: flex;
justify-content: space-between;
align-items: center;
width: 90%;
max-width: 1000px;
margin: 40px auto 0 auto;
}
.website__rights {
color: #fff;
}
#media screen and (max-width: 820px) {
.footer__links {
padding-top: 2rem;
}
#footer__logo {
margin-bottom: 2rem;
}
.website__rights {
padding: 2rem;
}
.footer__link--wrapper {
flex-direction: column;
}
.social__media--wrap {
flex-direction: column;
}
}
#media screen and (max-width: 480px) {
.footer__link--items {
margin: 0;
padding: 10px;
width: 100%;
}
}
/* Text above the form*/
/* Feedback form*/
.form1 {
display: flex;
flex-direction: column;
align-items: center;
width: 500px;
margin: 15vh auto;
border-radius: 15px;
border: none;
box-shadow: 0 0 15px rgb(24, 143, 190);
}
form {
display: flex;
flex-direction: column;
align-items: center;
width: 90%;
}
input {
width: 100%;
margin: 5px 0;
height: 35px;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
textarea {
width: 100%;
margin: 5px 0;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
input[type="submit"] {
margin: 10px auto;
width: 120px;
background: rgb(24, 143, 190);
color: white;
cursor: pointer;
}
input[type="submit"]:hover {
background: rgb(19, 41, 238);
}
#media screen and (max-width: 600px) {
.form1 {
width: 90%;
}
}
h2 {
color: #00ffd5;
font-size: 30px;
}
p4 {
color: #00ffd5;
font-size: 20px;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="img/icon.png" />
<link rel="stylesheet" href="styles.css" />
<title>Contact Us</title>
</head>
<body>
<!-- Alert bar -->
<div class="container">
<div class="alert">
<span
class="closebtn"
onclick="this.parentElement.style.display='none';"
>×</span
>
<center>
<strong>DEALS NOW ON!</strong> Upto 30% discounts this christmas
</center>
</div>
<!-- Navigation bar -->
<ul class="topnav">
<li><img src="img/logo.png" /></li>
<li>Home</li>
<li>Products</li>
<li><a class="active" href="contactus.html">Contact Us</a></li>
<li class="right">About Us</li>
</ul>
<!-- Form -->
<div class="form1">
<h2>Contact Us!</h2>
<p4>Typical Replies Within 24hrs!</p4>
<br />
<form action="">
<input
type="email"
name="email"
id="email"
placeholder="Enter your email"
/>
<input
type="text"
name="name"
id="name"
placeholder=" Enter your name"
/>
<textarea
name="message"
id="message"
cols="30"
rows="10"
placeholder="Enter your message here"
></textarea>
<input type="submit" value="Send" />
</form>
</div>
</div>
<!-- Footer -->
<div class="footer__container">
<div class="footer__links">
<div class="footer__link--wrapper">
<div class="footer__link--items">
About Us
</div>
<div class="footer__link--items">
Contact Us
</div>
</div>
<div class="footer__link--wrapper">
<div class="footer__link--items">
Youtube
</div>
<div class="footer__link--items">
TikTok
</div>
</div>
</div>
<section class="social__media">
<div class="social__media--wrap">
<div class="footer__logo">
<a href="index.html">
<img src="img/logo2.png" id="footer__logo"
/></a>
</div>
<p class="website__rights">
© KIPPLO.CO.UK PROTOTYPE 2022. All rights reserved
</p>
<div class="social__icons"></div>
</div>
</section>
</div>
</body>
</html>

Auto adjusting form using margin

I'm using margins for my form but when I am testing the responsive layout the distance between the navigation bar increases if the screen width is a greater size. Therefore, I have also tried auto height but it still has a big gap between the navigation bar and the form.
I have also tried #media screen.
I had help yesterday with a similar problem to this, but now I'm encountering another one as its not with the footer but with the form itself.
I would kindly like to ask for help, and if you find a solution explain the changes so I can also learn from it! Kindest regards, Caelan : ).
body {
background-color: black;
}
/* Announcment bar */
.alert {
padding: 20px;
background-color: #2a7a85;
color: white;
}
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}
.closebtn:hover {
color: black;
}
body {
margin: 0;
}
/* Navigation bar */
ul.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgb(248, 248, 248);
}
ul.topnav li {
float: left;
}
ul.topnav li a {
display: block;
color: black;
text-align: center;
font-weight: bold;
padding: 25px 32px;
text-decoration: none;
}
ul.topnav li a:hover:not(.active) {
background-color: rgb(55, 81, 165);
}
ul.topnav li a.active {
background-color: #0cc0d8;
}
ul.topnav li.right {
float: right;
}
#media screen and (max-width: 600px) {
ul.topnav li.right,
ul.topnav li {
float: none;
}
}
/* On smaller screens, decrease text size */
#media only screen and (max-width: 300px) {
.text {
font-size: 11px;
}
}
/* Homepage button */
.glow-on-hover {
width: 220px;
height: 35px;
border: none;
outline: none;
color: rgb(0, 0, 0);
font-weight: bold;
font-size: 20px;
background: #111;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
}
.glow-on-hover:before {
content: "";
background: linear-gradient(
45deg,
#ff0000,
#ff7300,
#fffb00,
#48ff00,
#00ffd5,
#002bff,
#7a00ff,
#ff00c8,
#ff0000
);
position: absolute;
top: -2px;
left: -2px;
background-size: 400%;
z-index: -1;
filter: blur(5px);
width: calc(100% + 4px);
height: calc(100% + 4px);
animation: glowing 20s linear infinite;
opacity: 0;
transition: opacity 0.3s ease-in-out;
border-radius: 10px;
}
.glow-on-hover:active {
color: #000;
}
.glow-on-hover:active:after {
background: transparent;
}
.glow-on-hover:hover:before {
opacity: 1;
}
.glow-on-hover:after {
z-index: -1;
content: "";
position: absolute;
width: 100%;
height: 100%;
background: rgb(11, 78, 223);
left: 0;
top: 0;
border-radius: 10px;
}
#keyframes glowing {
0% {
background-position: 0 0;
}
50% {
background-position: 400% 0;
}
100% {
background-position: 0 0;
}
}
/* kipplo heading on homepage */
h1 {
font-size: 10vw;
margin: 0;
padding: 0;
font-family: "Courier New", Courier, monospace;
color: blue;
word-wrap: break-word;
text-align: center;
}
/* for the heading and the button alignment*/
.container {
display: flex;
flex-direction: column;
height: 100vh;
}
.btn-centering {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* product cards*/
h3 {
text-align: center;
font-size: 30px;
margin: 0;
padding-top: 10px;
}
a {
text-decoration: none;
}
.gallery {
display: flex;
flex-wrap: wrap;
width: 100%;
justify-content: center;
align-items: center;
margin: 50px 0;
}
.content {
width: 24%;
margin: 15px;
box-sizing: border-box;
float: left;
text-align: center;
border-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-top: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
transition: 0.4s;
background-color: whitesmoke;
}
.content:hover {
box-shadow: 0 0 11px rgb(0, 217, 255);
transform: translate(0px, -8px);
transition: 0.6s;
}
.productcard-image {
width: 200px;
height: 200px;
text-align: center;
margin: 0 auto;
display: block;
}
p {
text-align: center;
color: #b2bec3;
padding: 0 8px;
}
h6 {
font-size: 26px;
text-align: center;
color: #222f3e;
margin: 0;
}
.product-card {
list-style-type: none;
display: flex;
justify-content: center;
align-items: center;
padding: 0px;
}
.productcard-list {
padding: 5px;
}
.fa {
color: #ff9f43;
font-size: 26px;
transition: 0.4s;
}
.fa:hover {
transform: scale(1.3);
transition: 0.6s;
}
.productcardbutton {
text-align: center;
font-size: 24px;
color: #fff;
width: 100%;
padding: 15px;
border: 0px;
outline: none;
cursor: pointer;
margin-top: 5px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.buy-1 {
background-color: #2183a2;
}
.buy-2 {
background-color: #3b3e6e;
}
.buy-3 {
background-color: #0b0b0b;
}
#media (max-width: 1000px) {
.content {
width: 46%;
}
}
#media (max-width: 750px) {
.content {
width: 100%;
}
}
/* Footer */
.footer__container {
background-color: #141414;
padding: 5rem 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#footer__logo {
color: #fff;
display: flex;
align-items: center;
cursor: pointer;
text-decoration: none;
font-size: 2rem;
}
.footer__links {
width: 100%;
max-width: 1000px;
display: flex;
justify-content: center;
}
.footer__link--wrapper {
display: flex;
}
.footer__link--items {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 16px;
text-align: left;
width: 160px;
box-sizing: border-box;
}
.footer__link--items h2 {
margin-bottom: 16px;
}
.footer__link--items > h2 {
color: #fff;
}
.footer__link--items a {
color: #fff;
text-decoration: none;
margin-bottom: 0.5rem;
}
.footer__link--items a:hover {
color: #e9e9e9;
transition: 0.3s ease-out;
}
/* Social Icons */
.social__icon--link {
color: #fff;
font-size: 24px;
}
.social__media {
max-width: 1000px;
width: 100%;
}
.social__media--wrap {
display: flex;
justify-content: space-between;
align-items: center;
width: 90%;
max-width: 1000px;
margin: 40px auto 0 auto;
}
.website__rights {
color: #fff;
}
#media screen and (max-width: 820px) {
.footer__links {
padding-top: 2rem;
}
#footer__logo {
margin-bottom: 2rem;
}
.website__rights {
padding: 2rem;
}
.footer__link--wrapper {
flex-direction: column;
}
.social__media--wrap {
flex-direction: column;
}
}
#media screen and (max-width: 480px) {
.footer__link--items {
margin: 0;
padding: 10px;
width: 100%;
}
}
/* Text above the form*/
/* Feedback form*/
.form1 {
display: flex;
flex-direction: column;
align-items: center;
width: 500px;
margin: 15vh auto;
margin-top: -200px;
height: auto;
border-radius: 15px;
border: none;
box-shadow: 0 0 15px rgb(24, 143, 190);
}
form {
display: flex;
flex-direction: column;
align-items: center;
width: 90%;
}
input {
width: 100%;
margin: 5px 0;
height: 35px;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
textarea {
width: 100%;
margin: 5px 0;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
input[type="submit"] {
margin: 10px auto;
width: 120px;
background: rgb(24, 143, 190);
color: white;
cursor: pointer;
}
input[type="submit"]:hover {
background: rgb(19, 41, 238);
}
#media screen and (max-width: 600px) {
.form1 {
width: 90%;
margin-top:-250px;
height: auto;
}
}
h2 {
color: #00ffd5;
font-size: 30px;
}
p4 {
color: #00ffd5;
font-size: 20px;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="img/icon.png" />
<link rel="stylesheet" href="styles.css" />
<title>Contact Us</title>
</head>
<body>
<!-- Alert bar -->
<div class="container">
<div class="alert">
<span
class="closebtn"
onclick="this.parentElement.style.display='none';"
>×</span
>
<center>
<strong>DEALS NOW ON!</strong> Upto 30% discounts this christmas
</center>
</div>
<!-- Navigation bar -->
<ul class="topnav">
<li><img src="img/logo.png" /></li>
<li>Home</li>
<li>Products</li>
<li><a class="active" href="contactus.html">Contact Us</a></li>
<li class="right">About Us</li>
</ul>
</div>
<!-- Form -->
<div class="form1">
<h2>Contact Us!</h2>
<p4>Typical Replies Within 24hrs!</p4>
<br />
<form action="">
<input
type="email"
name="email"
id="email"
placeholder="Enter your email"
/>
<input
type="text"
name="name"
id="name"
placeholder=" Enter your name"
/>
<textarea
name="message"
id="message"
cols="30"
rows="10"
placeholder="Enter your message here"
></textarea>
<input type="submit" value="Send" />
</form>
</div>
</div>
<!-- Footer -->
<div class="footer__container">
<div class="footer__links">
<div class="footer__link--wrapper">
<div class="footer__link--items">
About Us
</div>
<div class="footer__link--items">
Contact Us
</div>
</div>
<div class="footer__link--wrapper">
<div class="footer__link--items">
Youtube
</div>
<div class="footer__link--items">
TikTok
</div>
</div>
</div>
<section class="social__media">
<div class="social__media--wrap">
<div class="footer__logo">
<a href="index.html">
<img src="img/logo2.png" id="footer__logo"
/></a>
</div>
<p class="website__rights">
© KIPPLO.CO.UK PROTOTYPE 2022. All rights reserved
</p>
<div class="social__icons"></div>
</div>
</[![section][1]][1]>
</div>
</body>
</html>
I analyzed your code. You have just to remove the height: 100vh from your .container.
The next step is to remove the margin-top: -250px from your .form1. then it should look good.
Bonus Tip: the unit vh stands for viewport-height (browser height). so 100vh is 100% of the viewport height.

Working on navbar and grid responsiveness

I can't seem to solve what was previously not a problem:
My navbar is fullwidth and mobile-y even above the breaking point
My grid boxes are not responsive on mobile even though I have set it to 1fr column and (6, fr) row.
https://codepen.io/arian-wardak/pen/QWKyzdj
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title>Services - Quantum Marketing</title>
<link rel="stylesheet" type="text/css" href="css/quantum.css">
<link rel="stylesheet" type="text/css" href="css/reset.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<main>
<nav>
<ul>
<li>Home</li>
<li><a class="active" href="services.html">Services</a></li>
<li>Contact</li>
<li>Account</li>
<li>Cite</li>
</ul>
</nav>
<div class="grid-services">
<div class="grid-item item-1">
<img src=img/coding.png alt="Coding Icon" width="64" height="51">
<h4>Web Development</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-2">
<img src=img/search.png alt="Search Icon with a Dollar Sign" width="64" height="64">
<h4>Search Engine Optimization</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-3">
<img src=img/copywriting.png alt="Notepad and Pencil Icon" width=64 height=57>
<h4>Copywriting</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-4">
<img src=img/email.png alt="Email Icon" width=64 height=64>
<h4>Email Marketing</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-5">
<img src=img/social.png alt="Social Media Icon" width=64 height=45>
<h4>Social Media Marketing</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-6">
<img src=img/retargeting.png alt="Bullseye Icon" width=64 height=64>
<h4>Retargeting</h4>
<div class="button">Choose</div>
</div>
</div>
</main>
<footer>
Copyright © 2020 Ariana Wardak. All Rights Reserved. | Privacy Policy Disclaimer | Designed by Ariana
</footer>
</body>
</html>
* {
box-sizing:border-box;
margin: 0;
font-family: 'Montserrat', sans-serif;
padding: 0;
outline: none;
}
body {
background-color: dimgray;
color: black;
}
main {
grid-area: main;
text-align:center;
overflow: hidden;
white-space: normal;
}
h1 {
padding: 20px;
color: white;
text-align: center;
}
h3 {
color: white;
text-align: center;
}
h4 {
padding: 30px;
color: white;
text-align: center;
}
.content {
margin: 0;
padding: 0;
background-color: white;
color: black;
}
.content img {
height: auto;
padding-right: 20px;
margin: 0;
}
nav {
overflow: hidden;
background-color: deepskyblue;
font-size: smaller;
}
ul {
display:block;
text-decoration: none;
text-align: center;
list-style: none;
float: right;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-decoration: none;
font-weight: bold;
text-transform: uppercase;
padding: 15px;
}
li a:hover {
background-color: deepskyblue;
}
li a.active {
background-color: navy;
}
.hero {
text-align: center;
background-color: navy;
padding: 200px 0;
}
.faq {
padding: 50px;
}
.accordion {
width: 90%;
max-width: 1000px;
margin: 2rem auto;
min-height: 300px;
}
.accordion-item {
background-color: #fff;
color: #111;
margin: 1rem 0;
border-radius: 0.5rem;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.25);
}
.accordion-item-header {
padding: 0.5rem 3rem 0.5rem 1rem;
min-height: 3.5rem;
line-height: 1.25rem;
font-weight: bold;
display: flex;
align-items: center;
position: relative;
cursor: pointer;
}
.accordion-item-header::after {
content: "\002B";
font-size: 2rem;
position: absolute;
right: 1rem;
}
.accordion-item-header.active::after {
content: "\2212";
}
.accordion-item-body {
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
.accordion-item-body-content {
padding: 1rem;
line-height: 1.5rem;
text-align: left;
border-top: 1px solid;
border-image: linear-gradient(to right, transparent, #34495e, transparent) 1;
}
.grid-services {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 300px 300px;
padding: 20px;
height: 100vh;
grid-gap: 20px;
}
.grid-item {
background-color: navy;
padding: 20px;
}
button,
.button,
.button-services,
.button-contact {
background-color: deepskyblue;
display: inline-block;
padding:10px 25px;
margin: 15px 20px;
font-weight: bold;
border-radius: 5px;
color: white;
text-decoration: none;
}
button:hover,
.button:hover,
.button-services:hover,
.button-contact:hover {
background-color: dimgray;
color: deepskyblue;
cursor: pointer;
transition: all 0.1s ease;
}
.faq {
padding: 50px;
}
.accordion {
width: 90%;
max-width: 1000px;
margin: 2rem auto;
min-height: 300px;
}
.accordion-item {
background-color: #fff;
color: #111;
margin: 1rem 0;
border-radius: 0.5rem;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.25);
}
.accordion-item-header {
padding: 0.5rem 3rem 0.5rem 1rem;
min-height: 3.5rem;
line-height: 1.25rem;
font-weight: bold;
display: flex;
align-items: center;
position: relative;
cursor: pointer;
}
.accordion-item-header::after {
content: "\002B";
font-size: 2rem;
position: absolute;
right: 1rem;
}
.accordion-item-header.active::after {
content: "\2212";
}
.accordion-item-body {
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
.accordion-item-body-content {
padding: 1rem;
line-height: 1.5rem;
text-align: left;
border-top: 1px solid;
border-image: linear-gradient(to right, transparent, #34495e, transparent) 1;
}
.contact {
max-width: 700px;
margin: auto;
}
.form {
max-width: 700px;
text-align: center;
margin: 20px auto;
display: grid;
grid-template-columns: 1fr 1em 2fr;
grid-gap: 0.3em 0.6em;
grid-auto-flow: dense;
align-items: center;
}
input, label {
display: block;
}
textarea {
resize: vertical;
max-height: 300px;
}
.profile {
background-color: white;
padding: 20px;
margin: auto;
color: black;
max-width: 800px;
text-align: center;
}
.profile h4 {
color: black;
}
.citations {
background-color: white;
padding: 20px;
margin: auto;
color: black;
max-width: 800px;
text-align: center;
}
.wrapper{
position: relative;
width: 500px;
background-color: navy;
margin: auto;
}
.profile_card{
height: 400px;
background: navy;
padding: 50px 25px;
position: relative;
z-index: 1;
padding: 20px;
}
.profile_card{
color: #fff;
text-align: center;
}
.profile_card .profile_img img{
width: 80px;
border-radius: 50%;
display: block;
margin: 0 auto;
}
.profile_card .profile_img .name{
font-size: 24px;
font-weight: 500;
margin: 15px 0 5px;
}
.profile_card .profile_img .place{
font-size: 14px;
font-weight: 300;
}
.profile_card .place .icon{
margin-right: 10px;
}
.profile_icons{
display: flex;
margin: 30px 0;
justify-content: center;
}
.profile_icons .profile_item{
margin-right: 15px;
}
.profile_icons .profile_item:last-child{
margin-right: 0;
}
.profile_icons .icon,
.profile_icons .number{
font-size: 24px;
}
.profile_icons .title{
font-size: 12px;
text-transform: uppercase;
margin: 10px 0;
}
.profile_btn{
background-color: deepskyblue;
padding: 10px;
border-radius: 25px;
width: 200px;
margin: 0 auto;
color: white;
cursor: pointer;
}
.profile_btn:hover{
background: #ffc208;
}
.settings_btn{
width: 50px;
height: 52px;
position: absolute;
bottom: 20px;
left: 225px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.settings_btn{
right: 0;
box-shadow: inset 2px -2px 3px ##00bfff;
}
.settings_btn:hover{
padding: 2px;
background-color: dimgray;
}
.profile_slider{
width: 325px;
height: 400px;
background: #fff;
color: #7b7a82;
position: absolute;
top: 25px;
left: 0;
font-size: 14px;
transition: bottom 0.2s ease;
}
.profile_slider li{
height: 80px;
border-bottom: 1px solid #eceff4;
padding: 15px;
}
.profile_slider li:last-child{
border-bottom: 0;
}
.profile_slider li .slider_item,
.profile_slider li .slider_left{
display: flex;
}
.profile_slider li .slider_item{
justify-content: space-between;
align-items: center;
height: 100%;
}
.profile_slider img{
width: 35px;
border-radius: 50%;
margin-right: 10px;
}
.profile_slider .item{
text-align: left;
font-size: 12px;
}
.profile_slider .item_email{
font-weight: 300;
margin-top: 5px;
}
.profile_slider .btn{
width: 100px;
padding: 8px 10px;
border-radius: 25px;
cursor: pointer;
font-size: 12px;
text-align: center;
}
.profile_slider .btn.btn_following{
background: #6a60c3;
color: #fff;
}
.profile_slider .btn.btn_following:hover{
background: #8178d1;
}
.profile_slider .btn.btn_follow{
border: 1px solid #7b7a82;
}
.profile_slider .btn.btn_follow:hover{
color: #fff;
background: #7b7a82;
}
.profile_slider.active{
left: 100%;
}
.settings_btn.active{
background: #00bfff;
}
.settings_btn i{
transition: transform 0.2s ease;
}
.settings_btn.active i{
transform: rotate(360deg);
}
.citations h4 {
color: black;
}
footer {
margin-bottom: 120px;
padding: 6px;
background-color: deepskyblue;
color: #ffffff;
text-align: center;
font-size: smaller;
}
#media screen and (max-width: 400px) {
nav {
float: none;
}
}
ul {
float: none;
}
li {
float: none;
width: 100%;
padding: 0;
}
.hero {
text-align: center;
padding: 180px 20px;
}
.connect {
margin: 0;
background-color: white;
color: black;
}
.connect img {
padding: 50px;
}
.content {
padding: 20px 8px;
}
}
.grid-services {
grid-template-columns: 1fr;
height: auto;
grid-template-rows: repeat(6, 1fr);
height: auto;
}
.form {
display: flex;
flex-direction: row;
color: white;
}
.form label {
flex: none;
display: block;
width: 250px;
font-weight: bold;
font-size: 1em;
display: inline-block;
}
.form label.right-inline {
text-align: right;
padding-right: 8px;
padding-left: 10px;
width: 300px;
}
.form .input-control {
flex: 1 1 auto;
display: block;
margin-bottom: 10px;
margin-right: 8px;
padding: 4px;
margin-top: -4px;
}
footer {
grid-area: footer;
margin: 0;
padding: 6px;
background-color: deepskyblue;
color: #ffffff;
text-align: center;
font-size: smaller;
}
You can use the Bootstrap class navbar; it already has breakpoints defined so you can have a presentable grid box at a small webpage size.

Making dropdown selection to fill element without gaps

I use menu that was created by other developer in our company. I add to the first item of the menu dropdown selection, but the problem that the dropdown box not fully fill the all the item and I can't make it fill.
Here is HTML:
<div class="main-container-top-menu scroll1" id="main-container-top-menu">
<div class="top-menu-item-container-empty">
<div style="width: 50px"></div>
</div>
<div class="top-menu-item-container">
<div class="inactive-border-bottom">
<p class="control has-icons-left is-expanded">
<span class="select is-fullwidth ">
<select class="full-height">
<option>dropdown</option>
<option>options 1</option>
</select>
</span>
<span class="icon is-small is-left"><i class="far fa-building"></i></span>
</p>
</div>
</div>
<div class="top-menu-item-container" >
<div>
<div class="top-menu-item">2. Lot and Model</div>
</div>
</div>
<div class="top-menu-item-container" >
<div [className]="ishpExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">3. Home Plan</div>
</div>
</div>
<div class="top-menu-item-container">
<div [className]="isupgExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">4. Upgrades</div>
</div>
</div>
<div class="top-menu-item-container">
<div [className]="isnextExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">5. Next Steps</div>
</div>
</div>
<div class="top-menu-icon-container">
<i class="fas fa-print top-menu-icon"></i>
<i class="fas fa-share-alt top-menu-icon"></i>
</div>
</div>
And here is CSS:
.scroll1::-webkit-scrollbar {
width: 0px;
height: 3px;
}
.scroll1::-webkit-scrollbar-track {
background: #eff0f0;
}
.scroll1::-webkit-scrollbar-thumb {
background: #666;
}
.main-container-top-menu {
scrollbar-width: auto;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.top-menu-item-container-empty {
border-bottom: 2px solid #eff0f0;
font-family: "Roboto", sans-serif;
border-right: 2px solid #eff0f0;
box-sizing: border-box;
color: #626262;
font-size: 14px;
font-weight: 350;
user-select: none;
justify-content: space-between;
}
.top-menu-item-container {
border-bottom: 2px solid #eff0f0;
font-family: "Roboto", sans-serif;
border-right: 2px solid #eff0f0;
box-sizing: border-box;
color: #626262;
font-size: 14px;
font-weight: 350;
user-select: none;
flex: 1;
justify-content: space-between;
}
.active-border-bottom {
align-items: center;
display: flex;
padding-left: 20px;
padding-right: 20px;
height: 100%;
border-bottom: 3px solid #eb2028;
box-sizing: border-box;
}
.inactive-border-bottom {
align-items: center;
display: flex;
padding-left: 20px;
padding-right: 20px;
height: 100%;
}
.top-menu-item-active {
cursor: pointer;
font-family: "Roboto", sans-serif;
padding: 5px;
font-family: "Roboto", sans-serif;
box-sizing: border-box;
color: #1d1d1d;
font-size: 14px;
font-weight: 350;
user-select: none;
align-items: center;
justify-content: center;
display: flex;
stroke-width: 0.6px;
-webkit-text-stroke-width: 0.6px;
flex: 1;
}
.top-menu-item {
cursor: pointer;
padding: 10px;
font-family: "Roboto", sans-serif;
box-sizing: border-box;
color: #626262;
font-size: 14px;
user-select: none;
align-items: center;
justify-content: center;
display: flex;
flex: 1;
}
.top-menu-item-first {
cursor: default;
border-right: 2px solid #eff0f0;
font-size: 14px;
padding-right: 20px;
font-weight: 800;
border-bottom: 2px solid #eff0f0;
border-left: none;
text-align: left;
justify-content: left;
flex: 1;
}
.top-right-menu-item {
/* margin-right: 50px; */
border-bottom: 2px solid #eff0f0;
height: 100%;
display: inline-flex;
justify-content: flex-end;
align-items: center;
}
.top-item-logo {
height: 55px;
z-index: 100;
width: 55px;
object-fit: contain;
}
.top-menu-icon-container{
display: flex;
align-items: center;
justify-content: center;
}
.top-menu-icon {
cursor: pointer;
margin-right: 25px;
margin-left: 25px;
cursor: pointer;
width: 14px;
padding-top: 25px;
padding-bottom: 25px;
}
.left-arrow,
.right-arrow {
display: none;
}
#media screen and (max-width: 768px) {
.constructor-top-container {
justify-content: center;
padding-left: 3%;
}
}
#media screen and (max-width: 1088px) {
.top-right-menu-item {
padding-left: 10px;
margin-right: 0px;
border-bottom: 2px solid #eff0f0;
flex: 1;
height: 100%;
display: inline-flex;
justify-content: flex-end;
align-items: center;
}
.main-container-top-menu {
padding-left: 0;
padding-right: 0;
padding-bottom: 3px;
}
}
#media screen and (max-width: 414px) {
.top-menu-icon {
margin-right: 15px;
cursor: pointer;
width: 14px;
padding-top: 12px;
}
.scroll1::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.scroll1::-webkit-scrollbar-track {
background: #eff0f0;
}
.scroll1::-webkit-scrollbar-thumb {
background: #666;
}
.top-menu-item-first {
padding-left: 35px;
}
.main-container-top-menu {
transition: 0.2s all;
min-height: 62px;
}
.top-item-logo {
position: absolute;
top: 0;
right: 0px;
margin: 0;
padding: 0;
z-index: 100;
height: 62px;
width: 62px;
object-fit: contain;
}
.left-arrow {
height: 60px;
padding-left: 5px;
padding-right: 5px;
background: white;
display: flex;
align-items: center;
position: absolute;
cursor: pointer;
color: #d1d1d1;
top: 0px;
font-size: 1.6rem;
left: 0;
z-index: 5;
padding-left: 7px;
}
.right-arrow {
height: 60px;
padding-left: 5px;
padding-right: 5px;
background: white;
display: flex;
align-items: center;
position: absolute;
cursor: pointer;
color: #b1b1b1;
font-size: 1.6rem;
left: calc(100% - 88px);
}
}
#media screen and (max-width: 1088px) {
.main-container-top-menu {
overflow-x: auto;
overflow-y: hidden;
/* display: block; */
width: 100%;
white-space: nowrap !important;
}
}
#media screen and (max-width: 414px) {
.main-container {
padding-left: 0px;
padding-right: 0px;
}
}
.no-suite-title {
text-transform: uppercase;
font-size: 1.3em;
font-weight: 300;
position: absolute;
left: 10%;
top: 50%;
z-index: 1000;
}
Workink jsFiddle!
How can I make dropdown to fill the menuc without gaps?
Update
Text moved to the left:
To get the desired result, you need to do the following:
Remove padding-left: 20px and padding-right: 20px from the .inactive-border-bottom selector;
Add height: 100% to these selectors - .control and .select.is-fullwidth.
Need to register .full-height in your css, and write the rule height: 100%!important in it. !important is necessary because this rule overrides the height: 2.5em rule in the .select select.

Site doesn't fit the viewport

I am running into some issues with resizing of the window (shrinking). When I shrink it down, the background colors no longer stay at the edge of the viewport, and content goes beyond it.
I thought that setting the width on the entire body to 100% would fix that, but it didn't?
Here is a JSFiddle of my current code, for the index page and the stylesheet:
* {
margin: 0;
padding: 0;
}
body {
font-family: Segoe UI, helvetica, arial;
display: flex;
flex-direction: column;
min-height: 100vh;
font-size: 18px;
width: 100%;
}
a {
color: hsl(344, 69%, 70%);
font-weight: bold;
}
a:hover {
text-decoration: none;
color: #67c3b2;
}
.menu-container {
background-color: rgba(150, 150, 150, 0.2);
padding: 20px 0;
display: flex;
justify-content: center;
text-transform: uppercase;
width: 100%;
}
.menu {
width: 90%;
display: flex;
top: 10px;
justify-content: space-between;
font-size: 16px;
overflow: hidden;
position: relative;
left: 10px;
}
.header-container {
background-color: rgba(150, 150, 150, 0.2);
display: flex;
justify-content: center;
height: 30px;
width: 100%;
position: relative;
}
.logo {
position: relative;
bottom: 37px;
z-index: 1;
}
.flex-container {
display: flex;
justify-content: center;
}
.flex-container p {
position: relative;
margin-left: 40px;
margin-right: 40px;
font-weight: bold;
top: 40px;
margin-top: 40px;
text-align: center;
}
.main {
display: flex;
color: #464646;
background: linear-gradient(to right, #77C9D4, #57BC90);
flex: 1;
}
.cakelist {
position: relative;
bottom: 50px;
display: flex;
font-weight: bold;
list-style-position: inside;
margin-top: 130px;
}
.cakelist ol,
table {
margin-left: 25px;
}
.cakelist h2 {
margin-left: 25px;
margin-top: 20px;
}
.carousel {
color: #464646;
top: 80px;
position: relative;
display: flex;
justify-content: center;
border: 3px outset gray;
align-items: center;
padding: 60px 60px 60px 60px;
}
.buttons {
position: relative;
width: 1600px;
margin-right: 25px;
justify-content: space-around;
display: flex;
top: 160px;
text-align: center;
}
.button a:hover {
opacity: 0.2;
}
.buttons p {
margin-top: 20px;
}
.buttons img {
padding-top: 25px;
height: 200px;
}
.gallery {
position: relative;
top: 80px;
}
.pricing {
display: flex;
position: relative;
top: 80px;
justify-content: center;
flex-direction: column;
padding-bottom: 140px;
}
.pricing p,
h1 {
margin-left: 250px;
text-align: left;
margin-top: 5px;
}
.pricing span {
opacity: 0;
user-select: none;
}
.order {
position: relative;
border-radius: 5px;
background: hsl(344, 69%, 70%);
top: 20px;
margin-top: 60px;
padding: 5px;
}
#order-link {
color: white;
text-decoration: none;
}
.order-button {
width: 180px;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.footer-container {
display: flex;
justify-content: flex-end;
align-items: center;
background: #9A9A9A;
height: 90px;
max-height: 90px;
}
.footer-logo {
height: 80px;
position: relative;
right: 10px;
}
.subscribe {
border-radius: 25px;
background: hsl(344, 69%, 70%);
padding: 5px 20px 5px 20px;
width: 80px;
}
#subscribe-link {
position: relative;
color: white;
text-decoration: none;
right: 40px;
}
<div class="menu-container">
<div class="menu">
<div class="flex-item">About Us</div>
<div class="flex-item">Cakes</div>
<div class="flex-item">Cupcakes</div>
<div class="flex-item">Gallery</div>
<div class="flex-item">Prices/Order</div>
<div class="flex-item">Search</div>
</div>
</div>
<header class="header-container">
<img src="TCCLogo.png" class="logo" />
</header>
<div class="flex-container main">
<div class="container">
<div class="carousel">
Here is where I will have the quick gallery/carousel when I get to JS.
</div>
<div class="buttons">
<div class="button">
<img src="cake.png" />
<p>Check out our delicious cake options!</p>
</div>
<div class="button">
<img src="cupcake.png" />
<p>Check out our delicious cupcake options!</p>
</div>
<div class="button">
<img src="prices.png" />
<p>Check out our competitive pricing!</p>
</div>
</div>
</div>
</div>
<footer class="footer-container">
<a id="subscribe-link" target="_blank" href="#">
<div class="subscribe">
<p>Subscribe</p>
</div>
</a>
<img src="TCCLogo.png" class="footer-logo" />
</footer>
I have tried going through my stylesheet, changing the widths on anything I have set with pixels to percentages, but it didn't seem to fix it. The only thing that -sort of- worked was changing the body position to fixed, but then none of the content was view-able if it got shrunk down, all it fixed was keeping the background/header/footer colors the same.
I imagine maybe my coding is a bit messy - I tried my best to be extensible, but being 100% new at this made it difficult.
Your problem is that you have width:1600px in .buttons just remove it and also add box-sizing:border-box to all (pseudo-)elements
EDIT:
you also need to add max-width:100% to .container and flex-wrap:wrap in .buttons
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box
}
body {
font-family: Segoe UI, helvetica, arial;
display: flex;
flex-direction: column;
min-height: 100vh;
font-size: 18px;
}
a {
color: hsl(344, 69%, 70%);
font-weight: bold;
}
a:hover {
text-decoration: none;
color: #67c3b2;
}
.menu-container {
background-color: rgba(150, 150, 150, 0.2);
padding: 20px 0;
display: flex;
justify-content: center;
text-transform: uppercase;
width: 100%;
}
.menu {
width: 90%;
display: flex;
top: 10px;
justify-content: space-between;
font-size: 16px;
overflow: hidden;
position: relative;
left: 10px;
}
.header-container {
background-color: rgba(150, 150, 150, 0.2);
display: flex;
justify-content: center;
height: 30px;
width: 100%;
position: relative;
}
.logo {
position: relative;
bottom: 37px;
z-index: 1;
}
.flex-container {
display: flex;
justify-content: center;
}
.flex-container p {
position: relative;
margin-left: 40px;
margin-right: 40px;
font-weight: bold;
top: 40px;
margin-top: 40px;
text-align: center;
}
.main {
display: flex;
color: #464646;
background: linear-gradient(to right, #77C9D4, #57BC90);
flex: 1;
}
.cakelist {
position: relative;
bottom: 50px;
display: flex;
font-weight: bold;
list-style-position: inside;
margin-top: 130px;
}
.cakelist ol,
table {
margin-left: 25px;
}
.cakelist h2 {
margin-left: 25px;
margin-top: 20px;
}
.container {
max-width: 100%
}
.carousel {
color: #464646;
top: 80px;
position: relative;
display: flex;
justify-content: center;
border: 3px outset gray;
align-items: center;
padding: 60px;
}
.buttons {
position: relative;
margin-right: 25px;
justify-content: space-around;
display: flex;
flex-wrap: wrap;
top: 160px;
text-align: center;
}
.button a:hover {
opacity: 0.2;
}
.buttons p {
margin-top: 20px;
}
.buttons img {
padding-top: 25px;
height: 200px;
}
.gallery {
position: relative;
top: 80px;
}
.pricing {
display: flex;
position: relative;
top: 80px;
justify-content: center;
flex-direction: column;
padding-bottom: 140px;
}
.pricing p,
h1 {
margin-left: 250px;
text-align: left;
margin-top: 5px;
}
.pricing span {
opacity: 0;
user-select: none;
}
.order {
position: relative;
border-radius: 5px;
background: hsl(344, 69%, 70%);
top: 20px;
margin-top: 60px;
padding: 5px;
}
#order-link {
color: white;
text-decoration: none;
}
.order-button {
width: 180px;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.footer-container {
display: flex;
justify-content: flex-end;
align-items: center;
background: #9A9A9A;
height: 90px;
max-height: 90px;
}
.footer-logo {
height: 80px;
position: relative;
right: 10px;
}
.subscribe {
border-radius: 25px;
background: hsl(344, 69%, 70%);
padding: 5px 20px 5px 20px;
width: 80px;
}
#subscribe-link {
position: relative;
color: white;
text-decoration: none;
right: 40px;
}
<div class="menu-container">
<div class="menu">
<div class="flex-item">About Us</div>
<div class="flex-item">Cakes</div>
<div class="flex-item">Cupcakes</div>
<div class="flex-item">Gallery</div>
<div class="flex-item">Prices/Order</div>
<div class="flex-item">Search</div>
</div>
</div>
<header class="header-container">
<img src="TCCLogo.png" class="logo" />
</header>
<div class="flex-container main">
<div class="container">
<div class="carousel">
Here is where I will have the quick gallery/carousel when I get to JS.
</div>
<div class="buttons">
<div class="button">
<img src="cake.png" />
<p>Check out our delicious cake options!</p>
</div>
<div class="button">
<img src="cupcake.png" />
<p>Check out our delicious cupcake options!</p>
</div>
<div class="button">
<img src="prices.png" />
<p>Check out our competitive pricing!</p>
</div>
</div>
</div>
</div>
<footer class="footer-container">
<a id="subscribe-link" target="_blank" href="#">
<div class="subscribe">
<p>Subscribe</p>
</div>
</a>
<img src="TCCLogo.png" class="footer-logo" />
</footer>
I have made it proper as you needed. And it's working for me.
Please add below css
.container, .buttons {
max-width: 100%;
}