Why is the block cropped at small screen resolutions? - html

Why does the block get cropped at small screen resolutions? I have a picture and a background with a minimum width, but even if I change it to a minimum, nothing works
Code https://jsfiddle.net/sxn05j7k/
I done
enter image description here
right
enter image description here
Site ilyin1ib.beget.tech
jQuery(($) => {
const selectSingle = document.querySelector('.__select');
const selectSingle_title = selectSingle.querySelector('.__select__title');
const selectSingle_span = selectSingle.querySelector('.__select__title > span');
const selectSingle_labels = selectSingle.querySelectorAll('.__select__label');
selectSingle_title.addEventListener('click', () => {
if ('active' === selectSingle.getAttribute('data-state')) {
selectSingle.setAttribute('data-state', '');
} else {
selectSingle.setAttribute('data-state', 'active');
}
});
for (let i = 0; i < selectSingle_labels.length; i++) {
selectSingle_labels[i].addEventListener('click', (evt) => {
const {
alt,
src
} = evt.currentTarget.querySelector('img')
const imgNode = selectSingle.querySelector('img')
imgNode.alt = alt
imgNode.src = src
selectSingle_span.textContent = evt.currentTarget.textContent
selectSingle.setAttribute('data-state', '')
});
}
$(".phone_mask").mask("+7 (999) 999-99-99");
});
html,
body {
font-family: 'Montserrat', sans-serif;
line-height: 1;
scroll-behavior: smooth;
background-color: #E5E5E5;
box-sizing: border-box;
height: 100%;
width: 100%;
}
*, *::before, *::after {
box-sizing: border-box;
}
.wrapper {
max-width: 1280px;
padding: 40px 80px;
box-sizing: border-box;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.item {
display: flex;
text-align: center;
background-color: #fff;
box-shadow: 0px 24px 80px rgba(0, 0, 0, 0.1);
border-radius: 1px;
}
.col {
width: 50%;
height: 100%;
}
.img {
display: flex;
position: relative;
background: url(../img/big-bg.png) center no-repeat;
background-size: 100% 100%;
min-height: 500px;
min-width: 560px;
}
.img img {
position: absolute;
left: 10px;
right: 0;
bottom: 42px;
margin: auto;
}
.img-info {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
width: 100%;
}
h1 {
font-weight: 700;
color: #fff;
font-size: 18px;
padding: 40px !important;
}
.img span {
font-weight: 700;
text-transform: uppercase;
font-size: 18px;
color: #fff;
padding: 0 0 40px 40px;
}
.form-block {
text-align: center;
}
.title {
background-color: #F8F8F8;
padding: 20px 100px;
border-radius: 50px;
}
h2 {
font-weight: 800;
font-size: 30px;
color: #212121;
}
form {
padding: 50px 100px !important;
}
label {
text-transform: uppercase;
text-align: left;
width: 100%;
font-weight: 800;
font-size: 12px;
display: inline-block;
margin-bottom: 10px !important;
}
.green {
color: #428A60;
}
input {
display: block;
margin: 0 auto;
border: 1px solid #E4E4E4;
box-sizing: border-box;
border-radius: 5px !important;
background: #F8F8F8;
padding: 15px 20px;
width: 100%;
margin-bottom: 20px !important;
}
input::placeholder {
font-weight: 600;
font-size: 14px;
}
.phone-block {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin-bottom: 40px;
}
.phone-block input {
margin-bottom: 0 !important;
}
.number {
margin-right: 20px;
}
button {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 12px;
background: #428A60;
border-radius: 5px !important;
border: none;
color: #fff;
cursor: pointer;
transition: 0.3s;
margin-bottom: 30px;
}
button i {
margin-left: 10px;
}
button:hover {
background-color: #3BC374;
color: #000;
}
.__select {
position: relative;
width: 118px;
height: 47px;
}
.__select[data-state="active"] .__select__title::before {
transform: translate(-3px, -50%) rotate(-45deg);
}
.__select[data-state="active"] .__select__title::after {
transform: translate(3px, -50%) rotate(45deg);
}
.__select[data-state="active"] .__select__content {
opacity: 1;
}
.__select[data-state="active"] .__select__label+.__select__input+.__select__label {
max-height: 40px;
border-top-width: 1px;
}
.__select__title {
display: flex;
align-items: center;
width: 100%;
height: 100%;
padding: 20px;
border-radius: 5px;
border: 1px solid #E4E4E4;
cursor: pointer;
background: #F8F8F8;
transition: 0.3s ease-out;
}
.__select__title::before,
.__select__title::after {
content: "";
position: absolute;
top: 50%;
right: 15px;
display: block;
width: 8px;
height: 2px;
transition: all 0.3s ease-out;
background-color: #333;
transform: translate(-3px, -50%) rotate(45deg);
}
.__select__title::after {
transform: translate(3px, -50%) rotate(-45deg);
}
.__select__title:hover {
border-color: #428A60;
}
.__select__title:hover::before,
.__select__title:hover::after {
background-color: #428A60;
}
.reset {
display: flex;
width: 230px;
padding: 8px 16px;
margin: 0 auto;
margin-bottom: 10px;
border: solid 1px #c7ccd1;
border-radius: 5px;
transition: all 0.2s ease-out;
cursor: pointer;
font-weight: bold;
background-color: #fff;
color: #333;
}
.reset:hover {
background-color: #428A60;
color: #fff;
}
.__select__content {
position: absolute;
top: 40px;
right: 0;
left: 0;
display: flex;
flex-direction: column;
background-color: #fff;
border: 1px solid #c7ccd1;
border-top: none;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
transition: all 0.3s ease-out;
opacity: 0;
z-index: 8;
}
.__select__input {
display: none;
}
.__select__input:checked+label {
background-color: #dedede;
}
.__select__input:disabled+label {
opacity: 0.6;
pointer-events: none;
}
.__select__label {
display: flex;
align-items: center;
width: 100%;
height: 40px;
max-height: 0;
padding: 0 16px;
transition: all 0.2s ease-out;
cursor: pointer;
overflow: hidden;
}
.__select__label+input+.__select__label {
border-top: 0 solid #c7ccd1 60;
}
.__select__label:hover {
background-color: #428A60 !important;
color: #fff;
}
.flag span {
font-weight: 600;
font-size: 14px;
margin-right: 10px;
}
.flag img {
width: 26px;
height: 18px;
margin-right: 20px;
}
.secure {
display: none;
font-size: 14px;
font-weight: 700;
background: #F8F8F8;
width: 339px;
}
.secure i {
color: #428A60;
padding: 10px;
}
#media screen and (max-width: 1300px) {
input {
padding: 15px 10px;
}
.title {
background-color: #F8F8F8;
padding: 20px 80px;
border-radius: 50px;
}
}
#media screen and (max-width: 1200px) {
.img {
min-width: 460px;
}
h1 {
padding: 20px !important;
}
.img span {
padding: 0 0 20px 20px !important;
}
}
#media screen and (max-width: 1220px) {
.phone_mask {
padding: 15px 10px;
}
}
#media screen and (max-width: 1220px) {
.phone_mask {
padding: 15px 5px;
}
}
#media screen and (max-width: 1100px) {
.wrapper {
height: auto;
}
.item {
flex-direction: column;
justify-content: center;
align-items: center;
padding: 40px;
}
.col {
width: auto;
flex-direction: column;
}
.img {
background: url(../img/min-bg.png) center no-repeat;
background-size: 82%;
min-height: 430px;
}
.img img {
position: static;
width: 80%;
}
.img-info {
position: static;
flex-direction: row;
}
h1, .img span {
padding: 0 !important;
color: #212121 !important;
}
.title {
background-color: transparent;
padding: 0;
margin-bottom: 40px
}
form {
padding: 0 !important;
}
.number {
margin-right: 10px
}
.phone_mask {
padding: 15px 20px;
}
.secure {
display: block;
}
}
#media screen and (max-width: 991px) {
.img {
background-size: 82%;
min-height: 430px;
}
.img img {
width: 80%;
}
}
#media screen and (max-width: 768px) {
.img {
background-size: 72%;
min-height: 360px;
min-width: 320px;
}
.img img {
width: 70%;
}
}
#media screen and (max-width: 700px) {
.img {
min-height: 350px;
}
}
#media screen and (max-width: 650px) {
.img {
min-height: 320px;
}
}
#media (max-width: 630px) {
.img {
min-height: 300px;
background-size: 67%;
}
.img img {
width: 65%;
}
}
#media (max-width: 630px) {
.img {
min-height: 290px;
background-size: 67%;
}
.img img {
width: 65%;
}
}
#media (max-width: 630px) {
.img {
min-height: 290px;
background-size: 67%;
}
.img img {
width: 65%;
}
}
#media (max-width: 560px) {
.img {
min-height: 280px;
}
}
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/8e0bceeac7.js" crossorigin="anonymous"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/clear.css" rel="stylesheet" type="text/css" />
<link href="css/adaptive.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/jquery.maskedinput#1.4.1/src/jquery.maskedinput.js" type="text/javascript"></script>
<script src="js/js.js"></script>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght#600;700;800&display=swap" rel="stylesheet">
<title>Редуслим</title>
</head>
<body>
<div class="wrapper">
<div class="item">
<div class="col img">
<div class="img-info">
<h1>Reduslim</h1>
<span>eco</span>
</div>
<img src="img/tablets.webp" alt="tablets">
</div>
<div class="col form-block">
<div class="title">
<h2>Сделай шаг<br>к выздоровлению</h2>
</div>
<form action="#" method="post">
<label for="name">ваше <span class="green">имя</span></label>
<input type="text" name="user_name" required id="name" placeholder="Алексей">
<div class="phone-block">
<div class="number">
<label for="phone">ваш <span class="green">телефон</span></label>
<input class="phone_mask" type="tel" name="user_phone" required id="phone" placeholder="+7 (123) 456 78-90">
</div>
<div class="__select" data-state="">
<div class="__select__title flag" data-default="Option 0">
<span>RU</span>
<img src="img/ru.svg" alt="ru">
</div>
<div class="__select__content">
<input id="singleSelect0" class="__select__input" type="radio" name="singleSelect" checked />
<label for="singleSelect0" class="__select__label">
</label>
<input id="singleSelect1" class="__select__input" type="radio" name="singleSelect" />
<label for="singleSelect1" class="__select__label flag">
<span>GR</span>
<img src="img/gr.svg" alt="gr">
</label>
<input id="singleSelect3" class="__select__input" type="radio" name="singleSelect" />
<label for="singleSelect3" class="__select__label flag">
<span>UK</span>
<img src="img/uk.svg" alt="">
</label>
<input id="singleSelect4" class="__select__input flag" type="radio" name="singleSelect" />
<label for="singleSelect4" class="__select__label flag">
<span>RU</span>
<img src="img/ru.svg" alt="ru">
</label>
</div>
</div>
</div>
<button>Заказать<i class="fas fa-arrow-right"></i></button>
</form>
</div>
<div class="secure">
<span>Trusted</span>
<span><i class="fas fa-lock"></i></span>
<span>Secure</span>
</div>
</div>
</div>
</body>

This happen because your <div class="secure"> has fixed width: width: 339px;.
Replace it with width: 100%; and max-width: 339px; and block will not crop anymore.
jQuery(($) => {
const selectSingle = document.querySelector('.__select');
const selectSingle_title = selectSingle.querySelector('.__select__title');
const selectSingle_span = selectSingle.querySelector('.__select__title > span');
const selectSingle_labels = selectSingle.querySelectorAll('.__select__label');
selectSingle_title.addEventListener('click', () => {
if ('active' === selectSingle.getAttribute('data-state')) {
selectSingle.setAttribute('data-state', '');
} else {
selectSingle.setAttribute('data-state', 'active');
}
});
for (let i = 0; i < selectSingle_labels.length; i++) {
selectSingle_labels[i].addEventListener('click', (evt) => {
const {
alt,
src
} = evt.currentTarget.querySelector('img')
const imgNode = selectSingle.querySelector('img')
imgNode.alt = alt
imgNode.src = src
selectSingle_span.textContent = evt.currentTarget.textContent
selectSingle.setAttribute('data-state', '')
});
}
$(".phone_mask").mask("+7 (999) 999-99-99");
});
html,
body {
font-family: 'Montserrat', sans-serif;
line-height: 1;
scroll-behavior: smooth;
background-color: #E5E5E5;
box-sizing: border-box;
height: 100%;
width: 100%;
}
*, *::before, *::after {
box-sizing: border-box;
}
.wrapper {
max-width: 1280px;
padding: 40px 80px;
box-sizing: border-box;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.item {
display: flex;
text-align: center;
background-color: #fff;
box-shadow: 0px 24px 80px rgba(0, 0, 0, 0.1);
border-radius: 1px;
}
.col {
width: 50%;
height: 100%;
}
.img {
display: flex;
position: relative;
background: url(../img/big-bg.png) center no-repeat;
background-size: 100% 100%;
min-height: 500px;
min-width: 560px;
}
.img img {
position: absolute;
left: 10px;
right: 0;
bottom: 42px;
margin: auto;
}
.img-info {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
width: 100%;
}
h1 {
font-weight: 700;
color: #fff;
font-size: 18px;
padding: 40px !important;
}
.img span {
font-weight: 700;
text-transform: uppercase;
font-size: 18px;
color: #fff;
padding: 0 0 40px 40px;
}
.form-block {
text-align: center;
}
.title {
background-color: #F8F8F8;
padding: 20px 100px;
border-radius: 50px;
}
h2 {
font-weight: 800;
font-size: 30px;
color: #212121;
}
form {
padding: 50px 100px !important;
}
label {
text-transform: uppercase;
text-align: left;
width: 100%;
font-weight: 800;
font-size: 12px;
display: inline-block;
margin-bottom: 10px !important;
}
.green {
color: #428A60;
}
input {
display: block;
margin: 0 auto;
border: 1px solid #E4E4E4;
box-sizing: border-box;
border-radius: 5px !important;
background: #F8F8F8;
padding: 15px 20px;
width: 100%;
margin-bottom: 20px !important;
}
input::placeholder {
font-weight: 600;
font-size: 14px;
}
.phone-block {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin-bottom: 40px;
}
.phone-block input {
margin-bottom: 0 !important;
}
.number {
margin-right: 20px;
}
button {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 12px;
background: #428A60;
border-radius: 5px !important;
border: none;
color: #fff;
cursor: pointer;
transition: 0.3s;
margin-bottom: 30px;
}
button i {
margin-left: 10px;
}
button:hover {
background-color: #3BC374;
color: #000;
}
.__select {
position: relative;
width: 118px;
height: 47px;
}
.__select[data-state="active"] .__select__title::before {
transform: translate(-3px, -50%) rotate(-45deg);
}
.__select[data-state="active"] .__select__title::after {
transform: translate(3px, -50%) rotate(45deg);
}
.__select[data-state="active"] .__select__content {
opacity: 1;
}
.__select[data-state="active"] .__select__label+.__select__input+.__select__label {
max-height: 40px;
border-top-width: 1px;
}
.__select__title {
display: flex;
align-items: center;
width: 100%;
height: 100%;
padding: 20px;
border-radius: 5px;
border: 1px solid #E4E4E4;
cursor: pointer;
background: #F8F8F8;
transition: 0.3s ease-out;
}
.__select__title::before,
.__select__title::after {
content: "";
position: absolute;
top: 50%;
right: 15px;
display: block;
width: 8px;
height: 2px;
transition: all 0.3s ease-out;
background-color: #333;
transform: translate(-3px, -50%) rotate(45deg);
}
.__select__title::after {
transform: translate(3px, -50%) rotate(-45deg);
}
.__select__title:hover {
border-color: #428A60;
}
.__select__title:hover::before,
.__select__title:hover::after {
background-color: #428A60;
}
.reset {
display: flex;
width: 230px;
padding: 8px 16px;
margin: 0 auto;
margin-bottom: 10px;
border: solid 1px #c7ccd1;
border-radius: 5px;
transition: all 0.2s ease-out;
cursor: pointer;
font-weight: bold;
background-color: #fff;
color: #333;
}
.reset:hover {
background-color: #428A60;
color: #fff;
}
.__select__content {
position: absolute;
top: 40px;
right: 0;
left: 0;
display: flex;
flex-direction: column;
background-color: #fff;
border: 1px solid #c7ccd1;
border-top: none;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
transition: all 0.3s ease-out;
opacity: 0;
z-index: 8;
}
.__select__input {
display: none;
}
.__select__input:checked+label {
background-color: #dedede;
}
.__select__input:disabled+label {
opacity: 0.6;
pointer-events: none;
}
.__select__label {
display: flex;
align-items: center;
width: 100%;
height: 40px;
max-height: 0;
padding: 0 16px;
transition: all 0.2s ease-out;
cursor: pointer;
overflow: hidden;
}
.__select__label+input+.__select__label {
border-top: 0 solid #c7ccd1 60;
}
.__select__label:hover {
background-color: #428A60 !important;
color: #fff;
}
.flag span {
font-weight: 600;
font-size: 14px;
margin-right: 10px;
}
.flag img {
width: 26px;
height: 18px;
margin-right: 20px;
}
.secure {
display: none;
font-size: 14px;
font-weight: 700;
background: #F8F8F8;
/*width: 339px;*/
max-width: 339px;
width: 100%;
}
.secure i {
color: #428A60;
padding: 10px;
}
#media screen and (max-width: 1300px) {
input {
padding: 15px 10px;
}
.title {
background-color: #F8F8F8;
padding: 20px 80px;
border-radius: 50px;
}
}
#media screen and (max-width: 1200px) {
.img {
min-width: 460px;
}
h1 {
padding: 20px !important;
}
.img span {
padding: 0 0 20px 20px !important;
}
}
#media screen and (max-width: 1220px) {
.phone_mask {
padding: 15px 10px;
}
}
#media screen and (max-width: 1220px) {
.phone_mask {
padding: 15px 5px;
}
}
#media screen and (max-width: 1100px) {
.wrapper {
height: auto;
}
.item {
flex-direction: column;
justify-content: center;
align-items: center;
padding: 40px;
}
.col {
width: auto;
flex-direction: column;
}
.img {
background: url(../img/min-bg.png) center no-repeat;
background-size: 82%;
min-height: 430px;
}
.img img {
position: static;
width: 80%;
}
.img-info {
position: static;
flex-direction: row;
}
h1, .img span {
padding: 0 !important;
color: #212121 !important;
}
.title {
background-color: transparent;
padding: 0;
margin-bottom: 40px
}
form {
padding: 0 !important;
}
.number {
margin-right: 10px
}
.phone_mask {
padding: 15px 20px;
}
.secure {
display: block;
}
}
#media screen and (max-width: 991px) {
.img {
background-size: 82%;
min-height: 430px;
}
.img img {
width: 80%;
}
}
#media screen and (max-width: 768px) {
.img {
background-size: 72%;
min-height: 360px;
min-width: 320px;
}
.img img {
width: 70%;
}
}
#media screen and (max-width: 700px) {
.img {
min-height: 350px;
}
}
#media screen and (max-width: 650px) {
.img {
min-height: 320px;
}
}
#media (max-width: 630px) {
.img {
min-height: 300px;
background-size: 67%;
}
.img img {
width: 65%;
}
}
#media (max-width: 630px) {
.img {
min-height: 290px;
background-size: 67%;
}
.img img {
width: 65%;
}
}
#media (max-width: 630px) {
.img {
min-height: 290px;
background-size: 67%;
}
.img img {
width: 65%;
}
}
#media (max-width: 560px) {
.img {
min-height: 280px;
}
}
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/8e0bceeac7.js" crossorigin="anonymous"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/clear.css" rel="stylesheet" type="text/css" />
<link href="css/adaptive.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/jquery.maskedinput#1.4.1/src/jquery.maskedinput.js" type="text/javascript"></script>
<script src="js/js.js"></script>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght#600;700;800&display=swap" rel="stylesheet">
<title>Редуслим</title>
</head>
<body>
<div class="wrapper">
<div class="item">
<div class="col img">
<div class="img-info">
<h1>Reduslim</h1>
<span>eco</span>
</div>
<img src="img/tablets.webp" alt="tablets">
</div>
<div class="col form-block">
<div class="title">
<h2>Сделай шаг<br>к выздоровлению</h2>
</div>
<form action="#" method="post">
<label for="name">ваше <span class="green">имя</span></label>
<input type="text" name="user_name" required id="name" placeholder="Алексей">
<div class="phone-block">
<div class="number">
<label for="phone">ваш <span class="green">телефон</span></label>
<input class="phone_mask" type="tel" name="user_phone" required id="phone" placeholder="+7 (123) 456 78-90">
</div>
<div class="__select" data-state="">
<div class="__select__title flag" data-default="Option 0">
<span>RU</span>
<img src="img/ru.svg" alt="ru">
</div>
<div class="__select__content">
<input id="singleSelect0" class="__select__input" type="radio" name="singleSelect" checked />
<label for="singleSelect0" class="__select__label">
</label>
<input id="singleSelect1" class="__select__input" type="radio" name="singleSelect" />
<label for="singleSelect1" class="__select__label flag">
<span>GR</span>
<img src="img/gr.svg" alt="gr">
</label>
<input id="singleSelect3" class="__select__input" type="radio" name="singleSelect" />
<label for="singleSelect3" class="__select__label flag">
<span>UK</span>
<img src="img/uk.svg" alt="">
</label>
<input id="singleSelect4" class="__select__input flag" type="radio" name="singleSelect" />
<label for="singleSelect4" class="__select__label flag">
<span>RU</span>
<img src="img/ru.svg" alt="ru">
</label>
</div>
</div>
</div>
<button>Заказать<i class="fas fa-arrow-right"></i></button>
</form>
</div>
<div class="secure">
<span>Trusted</span>
<span><i class="fas fa-lock"></i></span>
<span>Secure</span>
</div>
</div>
</div>
</body>

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.

right div dissappears when window resizes

I have two divs sort of like a 50 50 divided screen, and so it looks good in computer size screen and in phone screen but right between these two, the right div just dissappears and I cant figure it out.
originally the code is echoed in php and the information is from a database so I put here some dummy info.
* {
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
font-family: 'Heebo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
body {
margin: 0;
padding: 72px 0 0 0;
overflow: hidden;
}
/*style for the slider container*/
.slidercon {
width: 50vw;
height: 100vh;
overflow: hidden;
float: left;
display: table;
}
.maincon {
width: 100%;
display: table-cell;
vertical-align: middle;
}
.imgslider {
margin: auto;
max-width: 560px;
max-height: 315px;
overflow: hidden;
position: relative;
}
.imgslider>ul {
margin: 0;
padding: 0;
display: flex;
position: relative;
top: 0;
left: 0;
transition: 0.2s;
width: 100%;
}
.imgslider>ul>li {
list-style-type: none;
min-width: 560px;
overflow: hidden;
}
.imgdiv {
width: 100%;
height: 315px;
justify-content: center;
text-align: center;
}
.imgdiv>img {
width: auto;
max-height: 315px;
}
.youtubevid {
display: flex;
display: -webkit-flex;
display: -ms-flex;
}
/*style for the dots*/
.dotsContainer {
text-align: center;
}
.dots {
cursor: pointer;
height: 20px;
width: 20px;
margin: 5px 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.dots:first-child {
background: white;
border: 1px solid grey;
;
}
/*content style*/
.content {
float: right;
width: 50vw;
height: 100vh;
overflow: hidden;
display: table;
text-align: right;
}
.innercont {
/* padding: 15px; */
direction: rtl;
display: table-cell;
vertical-align: middle;
}
.innercont>span:first-child {
font-size: 40px;
padding: 25px;
display: block;
}
.innercont>span:nth-child(2) {
padding: 25px;
font-size: 20px;
display: block;
word-wrap: break-word;
}
.price {
padding: 10px;
font-size: 22px;
}
.price>span {
margin: 0 15px;
}
.price>span:nth-child(2) {
float: left;
}
/*style for the phone number input*/
.PhoneN-section {
position: relative;
height: 50px;
margin: 15px;
}
.PhoneN-section input {
width: 100%;
height: 100%;
border-radius: 10px;
outline: none;
border: 1px solid rgb(230, 230, 230);
font-size: 20px;
padding: 10px 10px 0 10px;
text-align: left;
direction: ltr;
}
input:focus~.PhoneN-label .label-content,
input:valid~.PhoneN-label .label-content {
transform: translateY(-120%);
}
label:not([for="checkbox"]) {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.label-content {
font-size: 20px;
position: absolute;
bottom: 10px;
right: 10px;
transition: all 0.3s ease;
background: white;
}
input:focus {
border: 2px solid rgb(76, 240, 0);
transition-delay: 0.2s;
}
/*style for the submit button*/
.phone-submit {
height: 50px;
margin: 15px 0;
}
.phone-submit button {
width: 100%;
height: 100%;
outline: none;
border: none;
border-radius: 10px;
color: white;
background: rgb(76, 240, 0);
cursor: pointer;
font-size: 20px;
}
/*style for the exclamation message*/
.mark {
float: right;
margin: 0 5px;
font-size: 14px;
font-weight: 600;
padding: 2px 7px;
border-radius: 50%;
border: 1px solid grey;
}
.messaget {
color: grey;
}
#media screen and (max-width: 850px) {
body {
overflow-y: auto;
}
.slidercon {
width: unset;
height: unset;
float: unset;
display: block;
}
.maincon {
display: block;
}
.content {
float: none;
width: unset;
height: 100vh;
display: block;
}
.innercont {
display: block;
}
}
#media screen and (max-width: 550px) {
.imgdiv {
justify-content: unset;
text-align: unset;
}
.imgdiv>img {
margin: 0 20%;
}
}
#media only screen and (max-width: 550px) {
.imgdiv>img {
margin: 0 10%;
}
}
#media only screen and (max-width: 420px) {
.imgdiv>img {
margin: 0 7%;
}
}
#media only screen and (max-width: 400px) {
.imgdiv>img {
margin: 0 5%;
}
}
<div class="slidercon">
<div class="maincon">
<div class="imgslider">
<ul>
<li>
<div class="imgdiv">
<img src="img" alt="item">
</div>
</li>
<li>
<div class="youtubevid">
<iframe style="position:absolute;width:100%;height:100%;" src="link" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</li>';
</ul>
</div>
<div class="dotsContainer">
<span class="dots"></span>
<span class="dots"></span>
</div>
</div>
</div>
<div class="content">
<div class="innercont">
<span>'Type'</span>
<span>'Description'</span>
<div class="price">
<span>Price</span>
<span>'1,111' ₪</span>
</div>
<form action="includes/sendPhone.php" method="POST">
<div class="PhoneN-section">
<input type="text" name="PhoneN" autocomplete="off" required />
<input type="hidden" name="itemid" value="id" />
<input type="hidden" name="itemtype" value="TYPE" />
<input type="hidden" name="price" value="1,111" />
<label for="PhoneN" class="PhoneN-label">
<span class="label-content">Phone Number</span>
</label>
<div class="phone-submit">
<button type="submit" name="phone-submit">SEND</button>
</div>
<span>
<span class="mark">!</span>
<span class="messaget">BLa lbla bla bla bla bla bla bla bla blab la</span>
</span>
</div>
</form>
</div>
</div>
In accordance to my understanding,your issue is that it is not responsive to some devices.
So i tried it out using flex box approach.
I added a container wrapper to all other divs and have it display its children in a flex manner.
Then added two inner containers each width 50vw containing your slider con and content respectively.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
* {
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
font-family: 'Heebo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
body {
margin: 0;
padding: 72px 0 0 0;
overflow: hidden;
}
.container{
display: flex;
}
.innercontainer{
width: 50vw;
}
/*style for the slider container*/
.slidercon {
width: 50vw;
height: 100vh;
overflow: hidden;
float: left;
display: table;
}
.maincon {
width: 100%;
display: table-cell;
vertical-align: middle;
}
.imgslider {
margin: auto;
max-width: 560px;
max-height: 315px;
overflow: hidden;
position: relative;
}
.imgslider>ul {
margin: 0;
padding: 0;
display: flex;
position: relative;
top: 0;
left: 0;
transition: 0.2s;
width: 100%;
}
.imgslider>ul>li {
list-style-type: none;
min-width: 560px;
overflow: hidden;
}
.imgdiv {
width: 100%;
height: 315px;
justify-content: center;
text-align: center;
}
.imgdiv>img {
width: auto;
max-height: 315px;
}
.youtubevid {
display: flex;
display: -webkit-flex;
display: -ms-flex;
}
/*style for the dots*/
.dotsContainer {
text-align: center;
}
.dots {
cursor: pointer;
height: 20px;
width: 20px;
margin: 5px 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.dots:first-child {
background: white;
border: 1px solid grey;
;
}
/*content style*/
.content {
float: right;
width: 50vw;
height: 100vh;
overflow: hidden;
display: table;
text-align: right;
}
.innercont {
/* padding: 15px; */
direction: rtl;
display: table-cell;
vertical-align: middle;
}
.innercont>span:first-child {
font-size: 40px;
padding: 25px;
display: block;
}
.innercont>span:nth-child(2) {
padding: 25px;
font-size: 20px;
display: block;
word-wrap: break-word;
}
.price {
padding: 10px;
font-size: 22px;
}
.price>span {
margin: 0 15px;
}
.price>span:nth-child(2) {
float: left;
}
/*style for the phone number input*/
.PhoneN-section {
position: relative;
height: 50px;
margin: 15px;
}
.PhoneN-section input {
width: 100%;
height: 100%;
border-radius: 10px;
outline: none;
border: 1px solid rgb(230, 230, 230);
font-size: 20px;
padding: 10px 10px 0 10px;
text-align: left;
direction: ltr;
}
input:focus~.PhoneN-label .label-content,
input:valid~.PhoneN-label .label-content {
transform: translateY(-120%);
}
label:not([for="checkbox"]) {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.label-content {
font-size: 20px;
position: absolute;
bottom: 10px;
right: 10px;
transition: all 0.3s ease;
background: white;
}
input:focus {
border: 2px solid rgb(76, 240, 0);
transition-delay: 0.2s;
}
/*style for the submit button*/
.phone-submit {
height: 50px;
margin: 15px 0;
}
.phone-submit button {
width: 100%;
height: 100%;
outline: none;
border: none;
border-radius: 10px;
color: white;
background: rgb(76, 240, 0);
cursor: pointer;
font-size: 20px;
}
/*style for the exclamation message*/
.mark {
float: right;
margin: 0 5px;
font-size: 14px;
font-weight: 600;
padding: 2px 7px;
border-radius: 50%;
border: 1px solid grey;
}
.messaget {
color: grey;
}
#media screen and (max-width: 850px) {
body {
overflow-y: auto;
}
.slidercon {
width: unset;
height: unset;
float: unset;
display: block;
}
.maincon {
display: block;
}
.content {
float: none;
width: unset;
height: 100vh;
display: block;
}
.innercont {
display: block;
}
}
#media screen and (max-width: 550px) {
.imgdiv {
justify-content: unset;
text-align: unset;
}
.imgdiv>img {
margin: 0 20%;
}
}
#media only screen and (max-width: 550px) {
.imgdiv>img {
margin: 0 10%;
}
}
#media only screen and (max-width: 420px) {
.imgdiv>img {
margin: 0 7%;
}
}
#media only screen and (max-width: 400px) {
.imgdiv>img {
margin: 0 5%;
}
}
</style>
<body>
<div class="container">
<div class="innercontainer">
<div class="slidercon">
<div class="maincon">
<div class="imgslider">
<ul>
<li>
<div class="imgdiv">
<img src="https://ewscripps.brightspotcdn.com/dims4/default/55e59a6/2147483647/strip/true/crop/1280x720+0+0/resize/1280x720!/quality/90/?url=https%3A%2F%2Fewscripps.brightspotcdn.com%2F9b%2F1c%2Fd6365aa54b5687a3cb1386a180db%2Fupdate-coronavirus-colorado-live-blog-covid19.png" alt="item">
</div>
</li>
<li>
<div class="youtubevid">
<iframe style="position:absolute;width:100%;height:100%;" src="link" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</li>';
</ul>
</div>
<div class="dotsContainer">
<span class="dots"></span>
<span class="dots"></span>
</div>
</div>
</div>
</div>
<div class="innercontainer">
<div class="content">
<div class="innercont">
<span>'Type'</span>
<span>'Description'</span>
<div class="price">
<span>Price</span>
<span>'1,111' ₪</span>
</div>
<form action="includes/sendPhone.php" method="POST">
<div class="PhoneN-section">
<input type="text" name="PhoneN" autocomplete="off" required />
<input type="hidden" name="itemid" value="id" />
<input type="hidden" name="itemtype" value="TYPE" />
<input type="hidden" name="price" value="1,111" />
<label for="PhoneN" class="PhoneN-label">
<span class="label-content">Phone Number</span>
</label>
<div class="phone-submit">
<button type="submit" name="phone-submit">SEND</button>
</div>
<span>
<span class="mark">!</span>
<span class="messaget">BLa lbla bla bla bla bla bla bla bla blab la</span>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
Else you can use various bootstrap frameworks to simplify your styling
The reason is max-width: 560px; in .imgslider class. I have added 50vw then it is working fine.
.imgslider {
margin: auto;
max-width: 50vh; /* updated */
max-height: 315px;
overflow: hidden;
position: relative;
}
Try below, It is working...
* {
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
font-family: 'Heebo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
body {
margin: 0;
padding: 72px 0 0 0;
overflow: hidden;
}
/*style for the slider container*/
.slidercon {
width: 50vw;
height: 100vh;
overflow: hidden;
float: left;
display: table;
}
.maincon {
width: 100%;
display: table-cell;
vertical-align: middle;
}
.imgslider {
margin: auto;
max-width: 50vh; /* updated line */
max-height: 315px;
overflow: hidden;
position: relative;
}
.imgslider > ul {
margin: 0;
padding: 0;
display: flex;
position: relative;
top: 0;
left: 0;
transition: 0.2s;
width: 100%;
}
.imgslider > ul > li {
list-style-type: none;
min-width: 560px;
overflow: hidden;
}
.imgdiv {
width: 100%;
height: 315px;
justify-content: center;
text-align: center;
}
.imgdiv > img {
width: auto;
max-height: 315px;
}
.youtubevid {
display: flex;
display: -webkit-flex;
display: -ms-flex;
}
/*style for the dots*/
.dotsContainer {
text-align: center;
}
.dots {
cursor: pointer;
height: 20px;
width: 20px;
margin: 5px 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.dots:first-child {
background: white;
border: 1px solid grey;;
}
/*content style*/
.content {
float: right;
width: 50vw;
height: 100vh;
overflow: hidden;
display: table;
text-align: right;
}
.innercont {
/* padding: 15px; */
direction: rtl;
display: table-cell;
vertical-align: middle;
}
.innercont > span:first-child {
font-size: 40px;
padding: 25px;
display: block;
}
.innercont > span:nth-child(2) {
padding: 25px;
font-size: 20px;
display: block;
word-wrap: break-word;
}
.price {
padding: 10px;
font-size: 22px;
}
.price > span {
margin: 0 15px;
}
.price > span:nth-child(2) {
float: left;
}
/*style for the phone number input*/
.PhoneN-section {
position: relative;
height: 50px;
margin: 15px;
}
.PhoneN-section input {
width: 100%;
height: 100%;
border-radius: 10px;
outline: none;
border: 1px solid rgb(230, 230, 230);
font-size: 20px;
padding: 10px 10px 0 10px;
text-align: left;
direction: ltr;
}
input:focus ~ .PhoneN-label .label-content,
input:valid ~ .PhoneN-label .label-content {
transform: translateY(-120%);
}
label:not([for="checkbox"]) {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.label-content {
font-size: 20px;
position: absolute;
bottom: 10px;
right: 10px;
transition: all 0.3s ease;
background: white;
}
input:focus {
border: 2px solid rgb(76, 240, 0);
transition-delay: 0.2s;
}
/*style for the submit button*/
.phone-submit {
height: 50px;
margin: 15px 0;
}
.phone-submit button {
width: 100%;
height: 100%;
outline: none;
border: none;
border-radius: 10px;
color: white;
background: rgb(76, 240, 0);
cursor: pointer;
font-size: 20px;
}
/*style for the exclamation message*/
.mark {
float: right;
margin: 0 5px;
font-size: 14px;
font-weight: 600;
padding: 2px 7px;
border-radius: 50%;
border: 1px solid grey;
}
.messaget {
color: grey;
}
#media screen and (max-width: 850px) {
body {
overflow-y: auto;
}
.slidercon {
width: unset;
height: unset;
float: unset;
display: block;
}
.maincon {
display: block;
}
.content {
float: none;
width: unset;
height: 100vh;
display: block;
}
.innercont {
display: block;
}
}
#media screen and (max-width: 550px) {
.imgdiv {
justify-content: unset;
text-align: unset;
}
.imgdiv > img {
margin: 0 20%;
}
}
#media only screen and (max-width: 550px) {
.imgdiv > img {
margin: 0 10%;
}
}
#media only screen and (max-width: 420px) {
.imgdiv > img {
margin: 0 7%;
}
}
#media only screen and (max-width: 400px) {
.imgdiv > img {
margin: 0 5%;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Stack Overflow</title>
<link rel="stylesheet" href="./styles.css">
</head>
<html>
<body>
<div class="slidercon">
<div class="maincon">
<div class="imgslider">
<ul>
<li>
<div class="imgdiv">
<img src="img" alt="item">
</div>
</li>
<li>
<div class="youtubevid">
<iframe style="position:absolute;width:100%;height:100%;" src="link" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</div>
</li>
</ul>
</div>
<div class="dotsContainer">
<span class="dots"></span>
<span class="dots"></span>
</div>
</div>
</div>
<div class="content">
<div class="innercont">
<span>'Type'</span>
<span>'Description'</span>
<div class="price">
<span>Price</span>
<span>'1,111' ₪</span>
</div>
<form action="includes/sendPhone.php" method="POST">
<div class="PhoneN-section">
<input type="text" name="PhoneN" autocomplete="off" required/>
<input type="hidden" name="itemid" value="id"/>
<input type="hidden" name="itemtype" value="TYPE"/>
<input type="hidden" name="price" value="1,111"/>
<label class="PhoneN-label">
<span class="label-content">Phone Number</span>
</label>
<div class="phone-submit">
<button type="submit" name="phone-submit">SEND</button>
</div>
<span>
<span class="mark">!</span>
<span class="messaget">BLa lbla bla bla bla bla bla bla bla blab la</span>
</span>
</div>
</form>
</div>
</div>
</body>
</html>
</html>

checkbox does not align inside div tag

Good day, somehow my check box and the text that needs to be beside it do not align in the same row. I have the code on JS Fiddle.
https://jsfiddle.net/6ejwdg9v/
The checkbox code is:
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="agree" value="agree" /> Agree with the terms and conditions
</label>
</div>
</div>
the classes form-group and checkbox are not touched with custom css code which is why I wonder how are they affected.
EDIT: I added the code in the "duplicate of another question" it did not do anything I still need help
changed class for .checkbox added
vertical-align: middle;
width: 20px;
also added
input[type=checkbox] {
width: 20px;
}
#font-face {
font-family: 'brandon_reg';
src: url('../fonts/brandon-grotesque-light.otf');
}
#font-face {
font-family: 'brandon_med';
src: url('../fonts/brandon-grotesque-medium.otf');
}
#font-face {
font-family: 'brandon_black';
src: url('../fonts/brandon-grotesque-black.otf');
}
html {
font-size: 100%;
}
body {
margin: 0 auto;
display: block;
/*REGISTER BACKGROUND*/
background-position: center;
background-repeat: no-repeat;
background-size: cover;
/*REGISTER BACKGROUND*/
}
.regular_bg {
font-family: 'brandon_reg';
}
.med_bg {
font-family: 'brandon_med';
}
.sml_padding {
margin: -10;
padding: -10;
}
.thick_bg {
font-family: 'brandon_black';
}
.thick_bg2 {
font-size: 35px;
}
#media only screen and (max-width : 767px) {
.box {
height: auto !important;
}
}
.fadeIn {
-webkit-animation: animat_show 0.8s;
animation: animat_show 0.8s;
visibility: visible !important;
}
#-webkit-keyframes animat_show{
0%{opacity:0}
100%{opacity:1}
}
.btn-group-sm>.btn, .btn-sm {
float: none;
}
.navbar-toggle {
display: inline-block;
float: none;
}
.full_width {
height: auto;
width:100%;
}
.ul_login {
color: #00a6a6;
}
.ul_reg {
color: #f08300;
}
.justify_text {
transform: translateT(-50);
text-align: justify;
padding: 2%;
display: flex;
justify-content: center;
align-items: center;
}
/*
.row_center {
display: flex;
}
.row_center>* {
flex: 1;
}
*/
.center-block {
margin-left:auto;
margin-right:auto;
display:block;
}
.icon_text_padding {
padding-bottom: 20px;
align-items: center;
margin: 0 auto;
}
.fab {
padding: 20px;
font-size: 50px;
color: #FFF;
}
.fab:hover {
color: #c9c9c9;
text-decoration: none;
}
/*IMPORTANT CSS FOR HEADER*/
.nav {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100px;
padding: 10px 100px;
box-sizing: border-box;
transition: .5s;
}
.list1 {
float: left;
font-size: 200%;
}
.list2 {
float: right;
font-size: 200%;
}
.list2 li a:hover {
color: #fff;
}
/*
.lines {
position: relative;
padding: 10px 0;
}
.lines:before {
content: '';
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
top: 0;
left: 0;
width: 32%;
height: 1px;
background: #cfcfcf;
}
.lines:after {
content: '';
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 10px;
bottom: 0;
left: 0;
width: 32%;
height: 1px;
background: #cfcfcf;
}
.lines_med:before {
width: 24%;
}
.lines_med:after {
width: 24%;
}
.lines_med2:before {
width: 27%;
}
.lines_med2:after {
width: 27%;
}
.lines_long:before {
width: 38%;
}
.lines_long:after {
width: 38%;
}
*/
nav .logo {
float: left;
}
nav .logo img {
height: 80px;
transition: 5s;
}
nav ul {
float: left;
margin: 0;
padding: 0;
display: flex;
}
nav ul li {
list-style: none;
}
nav ul li a {
line-height: 80px;
color: #262626;
padding: 5px 20px;
text-decoration: none;
transition: .5s;
}
nav ul li a:hover {
color: #fff;
background: #00a6a6;
text-decoration: none;
}
footer {
width: 100%;
background-color: #00a6a6;
padding: 3%;
color: #FFF;
}
.carousel-control.left, .carousel-control.right {
background-image:none !important;
filter:none !important;
}
.container-fluid {
max-width: 1200px;
}
footer .container-fluid {
max-width: 100%;
}
.footer_links a h4 {
color: #fff;
}
.footer_links a:hover {
color: #fff;
text-decoration: underline;
}
.faq a:hover {
text-decoration: none !important;
}
.info_container {
max-width: 1920px;
width: 100%;
margin: 0 auto;
}
.info_box h2 {
text-align: center;
}
.info_header {
padding-top: 4%;
padding-bottom: 4%;
}
.bottom_padding {
padding-bottom: 4%;
}
.info_font {
font-size: 18px;
}
.mv_font {
font-size: 20px;
text-align: left;
}
.contact_font {
font-size: 20px;
text-align: center;
}
.center_font {
margin: 0 auto;
text-align: center;
}
#icon {
max-width: 90%;
}
#media (max-width: 600px){
#icon {
max-width: 150px;
}
h4 {
font-size: 1.7em;
}
}
/*CONTACT PAGE*/
.text_field_design {
padding: 50px 0 80px;
text-align: center;
}
.text_field_design p {
padding-bottom: 80px;
color: #737373;
}
.text_field_design h2 {
color: #4c4c4c;
margin: 20px 0 20px;
}
.text_field_design .input-group {
margin-bottom: 25px;
}
.input-group-addon {
padding: -50px !important;
font-size: 20px;
}
.text_field_design .form-control {
border-radius: 0 !important;
}
.text_field_design span {
border-radius: 0 !important;
}
.text_field_design .btn {
border-radius: 0;
width: 100%;
font-size: 15px;
background-color: #f08300;
color: #fff;
}
.text_field_design .btn:hover {
background-color: #f3a64c;
color: #fff !important;
}
.box_shadow {
box-shadow: 10px 10px 5px grey;
}
.curved_img {
border-radius: 10px;
}
/*REGISTER*/
.reg_box {
width: 90%;
padding: 70px 70px 10px;
background: #fff;
top: 50%;
left: 50%;
margin: 0 auto;
opacity: 0.9;
border-radius: 30px;
}
.reg_box p {
margin: 0;
padding: 0;
font-weight: bold;
}
.reg_box input {
width: 100%;
margin-bottom: 20px;
}
.reg_box input[type="text"], input[type="password"] {
border: none;
border-bottom: 1px solid #000;
background: transparent;
outline: none;
height: 40px;
}
.reg_box input[class="reg_signup"] {
font-family: 'brandon_med';
border: none;
outline: none;
height: 40px;
background: #f08300;
color: #fff;
font-size: 18px;
margin-top: 20px;
}
.reg_box input[class="reg_fb"] {
font-family: 'brandon_med';
border: none;
outline: none;
height: 40px;
background: #3b579d;
color: #fff;
font-size: 18px;
}
.reg_box input[class="reg_google"] {
font-family: 'brandon_med';
border: none;
outline: none;
height: 40px;
background: #2eaa52;
color: #fff;
font-size: 18px;
}
.checkbox {
float: left !important;
display: block;
margin-top: 10px;
margin-bottom: 10px;
width: 100%;
vertical-align:middle;
}
/*
.register_form {
text-align: center;
margin: 100px 400px;
}
.registration {
width: 100%;
background-color: #fff;
opacity: 0.9;
padding: 50px 0px;
}
.align_left_reg {
text-align: left;
font-size: 18px;
}
#text_field {
width: 250px;
border-radius: 5px;
padding: 5px;
}
#phone {
width: 250px;
padding: 5px;
border-radius: 5px;
outline: 0px;
}
#rd {
font-family: 'brandon_med';
}
.button_container {
max-width: 60%;
}
.ref_button {
width: 100px;
height: 40px;
font-size: 18px;
background-color: #f08300;
color: #fff;
}
.fb_button {
width: 200px;
height: 40px;
font-size: 18px;
background-color: #3b579d;
color: #fff;
}
.fb_button:hover {
background-color: #3662d0;
}
.ref_button:hover {
background-color: #f3a64c;
color: #fff !important;
}
element.style {
color: white;
}
REGISTER*/
input[type=checkbox] {
width: 20px;
}
<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">
<title>My White Card</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body style="background-color:#000;" class="regular_bg">
<br><br>
<div class="reg_box">
<div class="row">
<div class="col-md-6">
<input type="submit" value="Sign Up With Facebook" class="reg_fb"></i>
</div>
<div class="col-md-6">
<input type="submit" value="Sign Up With Google" class="reg_google"></i>
</div>
</div>
<br>
<form>
<div class="row">
<div class="col-md-6 col-sm-12">
<p>First Name</p>
<input type="text" placeholder="First Name">
<p>Email</p>
<input type="text" placeholder="Email">
<p>Password</p>
<input type="password" placeholder="Password">
</div>
<div class="col-md-6 col-sm-12">
<p>Last Name</p>
<input type="text" placeholder="Last Name">
<p>Number</p>
<input type="text" placeholder="Number">
<p>Retype Password</p>
<input type="password" placeholder="Retype Password">
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="agree" value="agree" /> Agree with the terms and conditions
</label>
</div>
</div>
<input type="submit" value="Sign Up" class="reg_signup">
</div>
</form>
</div>
</body>
</html>
Turning the label into a flexbox will give you vertical alignment.
.checkbox label {
display: flex;
align-items: center; /* Vertical alignment */
}
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="agree" value="agree" /> Agree with the terms and conditions
</label>
</div>
</div>

Mobile view of the contact page bug

just such a problem – my contact page has a view bug when in the mobile view – the footer is aroused almost all over the screen and the contact form is on itsee screenshot, I marked the div that obviously causes problems . Checked all the HTML tags – they're OK, tried position of the objects in the CSS – nothing helps. In the desktop view everything looks OKsee screenshot. Here is the HTML document and a CSS file linked there. They are better to copy to an editor to run in a browser.
a {
color: #f91111;
}
a:hover {
color: #fff;
background: #f91111;
text-decoration: none;
}
body {
margin: 0;
padding: 0;
font-size: 97%;
line-height: 1.4em;
min-width: 500px;
font-family: Helvetica;
letter-spacing: 101%;
min-height: 100%;
}
header {
margin-bottom: 1%;
background-image: url(../images/DSC00075.JPG);
background-position: 0% 7%;
background-size: 100%;
background-opacity: 0.9;
background-color: #f91111;
padding: 1% 0 0%;
position: fixed;
z-index: 10;
width: 100%;
}
.header {
max-width: 1310px;
margin: 0 auto;
}
.collapse {
display: none;
}
.panel-group .panel-heading+.panel-collapse>.panel-body,
.panel-group .panel-heading+.panel-collapse>.list-group {
border-top: 1px solid #ddd;
}
main {
margin: 0 auto;
/* padding: 10% 15% 2.9%; */
font-size: 94%;
max-width: 1310px;
padding-top: 200px !important;
min-height: calc(74.75vh);
}
nav {
max-width: 750px;
text-align: left;
padding-bottom: 0.85em;
padding-left: 0.35em;
}
nav a {
display: inline;
text-align: left;
text-decoration: none;
padding: 2%;
margin-right: 4.8%;
border-radius: 5px;
color: #fff;
line-height: 1em;
}
nav a:hover {
background-color: #fff;
color: #000;
}
a.active {
background-color: #fff;
color: #000;
}
.footer {
font-size: 0.75rem;
padding: 1.5% 15% 1.25% 14.4%;
color: #fff;
}
h1 {
font-size: 4rem;
padding-bottom: 1rem;
padding-left: 0.8%;
color: #fff;
}
h2 {
font-size: 2.5em;
color: #f91111;
margin-bottom: 2.5rem;
line-height: 1.25em;
}
h3 {
font-size: 1.3em;
color: #f91111;
padding: 0.25% 0%;
}
h3.lebenslauf {
background: #f91111;
color: #fff;
padding: 0.25% 0% 0.25% 1%;
}
.hr4 .lightborder {
display: block;
width: 93%;
border-bottom: 1px solid #e8e8e8;
position: relative;
z-index: 1;
}
span.ul-second-line {
/*padding-left: 10px;*/
margin-left: 7px;
}
ul.Lebenslauf {
padding-left: 16px;
margin-top: 0px;
}
p.no-margin-before {
-webkit-margin-before: 0;
}
div.button {
display: inline;
font-size: 0.75rem;
padding: 5px;
margin-right: 10px;
min-width: 15%;
}
div.table-row {
max-width: 100%;
display: block;
margin-bottom: 0.75rem;
padding-left: 1px;
font-size: 0.95em;
}
div.left {
float: left;
width: 20%;
min-width: 150px;
display: inline;
}
div.right {
width: 75%;
display: inline-block;
}
.empty-bottom {
height: auto;
}
a.up-there {
text-decoration: none;
padding: 3px 5px;
}
div.kategorie a.up-there {
margin-right: -9px;
}
div.kategorie a.up-there:hover {
margin-right: 0px;
}
.collapse {
display: none;
}
strong.red-accentuation {
color: #f91111;
}
footer {
max-width: 100%;
background-color: #f91111;
padding: 0 2%;
vertical-align: bottom;
}
footer a {
color: white;
text-decoration: none;
margin-bottom: 0;
}
footer a:hover {
text-decoration: underline;
}
#image {
text-align: center;
width: auto;
border: none;
margin: 0 auto;
margin-bottom: 10px;
background-color: none;
font-size: 100%;
background-image: url('');
}
.empty-space {
text-align: right;
}
#image-alternative {
text-align: center;
margin: 0 auto;
margin-bottom: 10px;
}
.preview {
width: 10%;
margin-left: 10px;
border: 3px solid #f91111;
border-radius: 5px;
height: 15%;
}
.container {
max-width: 95%;
margin: 3% auto;
margin-left: 0;
padding: 10px;
padding-left: 0;
background-color: none;
overflow: hidden;
box-shadow: none;
}
.gallery ul {
list-style: none;
padding: 0;
margin: 0 auto;
}
.gallery li {
display: inline;
width: 50%;
height: 30vh;
margin: 2%;
margin-left: 0;
position: relative;
font-size: 0;
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
display: none;
overflow: hidden;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.fade.in {
opacity: 1;
}
.fade {
opacity: 0;
-webkit-transition: opacity .15s linear;
-o-transition: opacity .15s linear;
transition: opacity .15s linear;
}
.referenz-link {
border: solid 1px #f91111;
border-radius: 10px;
width: 200px;
height: 200px;
margin-right: 30px;
margin-bottom: 30px;
overflow: hidden;
display: inline-block;
background: #f91111;
}
.referenz-link:last-child {
margin-right: 0px;
}
.referenz-link:hover {
background: none;
}
.picture-keeper {
overflow: hidden;
height: 133px;
margin-bottom: 10px;
border-bottom: solid 1px #f91111;
background: #fff;
}
img.reference {
width: 100%;
}
.notation {
padding: 0px 10px 15px;
text-align: center;
}
.referenz-link a {
color: #fff;
text-decoration: none;
font-weight: 700;
}
.referenz-link a:hover {
color: #f91111;
background: #fff;
}
h1.header {
display: inline-block;
}
img.presentation {
display: block;
margin-left: -1em;
}
h2.with-picture {
display: inline-block;
}
.foto-presentation {
text-align: center;
margin-bottom: 2.5em;
}
.adress-left {
display: inline-block;
float: left;
width: 48%;
margin-right: 2%;
}
.form-right {
display: inline-block;
width: 48%;
float: right;
}
dd,
dt {
display: inline-block;
}
dd {
margin-left: 0;
}
dt {
width: 7em;
}
dl {
-webkit-margin-before: 0;
-webkit-margin-after: 0;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
}
address {
font-style: normal;
}
label.kontaktangabe {
width: 8em;
display: inline-block;
}
textarea,
input[type="text"] {
border: solid 1px #f91111;
border-radius: 3px;
padding: 4px;
line-height: 1.5em !important;
}
textarea {
font: 400 0.95em Arial;
}
div#nachricht label {
vertical-align: top;
}
button.buttons {
color: #fff;
background: #f91111;
border: none;
border-radius: 3px;
font-size: 14px;
padding: 7px;
}
button.buttons:hover {
background: #a60c0c;
}
#kontaktdaten div.table-row {
font-size: 1em;
}
#kontaktdaten form {
padding-top: 1em;
}
#media screen and (min-width: 500px) and (max-width: 790px) {
header {
background-position: 0% 10%;
background-size: 100%;
padding: 1% 1% 1%;
margin: 0;
}
h1 {
font-size: 3rem;
}
nav a {
padding: 1.5%;
margin-right: 1%;
border-radius: 2px;
}
nav {
align: left;
padding-bottom: 0.1rem;
}
main {
margin: 0% 1%;
padding: 1%;
}
div.left {
margin-right: 1rem;
min-width: none;
}
.referenz-link {
width: 200px;
height: 200px;
margin-right: 45px;
margin-bottom: 45px;
}
.referenz-link:last-child {
margin-right: 0px;
}
.picture-keeper {
height: 133px;
}
.notation {
font-size: 1em;
}
.adress-left {
display: block;
width: 95%;
margin-bottom: 2em;
}
.form-right {
display: block;
width: 95%;
float: left;
}
label.kontaktangabe {
display: block;
}
}
#media screen and (max-width: 480px) {
body {
max-width: 450px;
font-size: 0.9rem;
padding: 0%;
}
header {
padding: 0% 1% 1%;
margin: 0;
background-position: 0% 0%;
background-repeat: no-repeat;
background-size: cover;
}
h1 {
font-size: 2rem;
}
nav {
max-width: 480px;
align: left;
padding-bottom: 0.6em;
}
nav a {
display: block;
text-align: left;
text-decoration: none;
padding: 1.5%;
margin: 0.5% 0%;
border-radius: 2px;
max-width: 30%;
}
main {
margin: 0% 0% 0% 1;
padding: 1% 0% 1% 1%;
max-width: 450px;
font-size: 100%;
}
div.left {
width: 100%;
float: none;
display: block;
min-width: 0;
}
div.right {
max-width: 100%;
display: block;
}
.hr4 .lightborder {
display: block;
max-width: 100%;
}
div.button {
display: block;
max-width: 50%;
text-align: center;
margin: 0 auto;
}
footer {
max-width: 480px !important;
}
.container {
padding: 0%;
}
img.preview {
margin-left: 0%;
margin-right: 2%;
}
.footer {
padding: 1.5% 0%;
max-width: 450px;
}
.referenz-link {
margin-right: 45px;
margin-bottom: 45px;
}
.notation {
font-size: 1.25em;
}
.adress-left {
display: block;
width: 95%;
margin-bottom: 2em;
}
.form-right {
display: block;
width: 95%;
float: left;
}
label.kontaktangabe {
display: block;
}
textarea.contact-form {
width: 379px;
}
dd,
dt {
display: block;
}
dd {
margin-bottom: 1em;
}
span.left {
font-weight: 700;
}
.kategorie .table-row {
margin-bottom: 2rem;
}
div#werdegang .table-row {
margin-bottom: 1em;
}
}
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Peter Schachnowskij – Homepage</title>
<link rel="stylesheet" href="css/portfolio.css">
</head>
<body>
<header>
<div class="header">
<h1>Peter Schachnowskij</h1>
<nav>
Startseite
Lebenslauf
Referenzen
Zeugnisse
<a class="active">Kontakt</a>
</nav>
</div>
</header>
<main>
<p> </p>
<h2>Kontakt</h2>
<div class="table-row" id="kontaktdaten">
<div class="adress-left">
<h3>Peter Schachnowskij</h3>
<p><address>Richterstraße 9<br>
70567 Stuttgart</address></p>
<p>
<dl><dt>Tel.:</dt>
<dd>01 76 / 21 75 17 11</dd>
</dl>
<dt>E-Mail: </dt>
<dd>peter.schachnowskij.gf#gmail.com</dd>
<p>
<p>
<dl><dt>Homepage:</dt>
<dd>noch im Aufbau</dd>
</dl>
<dl><dt>XING-Profil:</dt>
<dd>https://www.xing.com/profile/Peter_Schachnowskij</dd>
</dl>
</p>
</div>
<div class="form-right">
<h3>Haben Sie ein Anliegen?</h3>
<p>Schreiben Sie mir gerne!</p>
<form action="mailto:peter.schachnowskij.gf#gmail.com" method="post">
<div class="table-row"><label class="kontaktangabe" for="name">Ihr Name*: </label><input type="text" value size="50" aria-required="true" aria-invalid="false" /></div>
<div class="table-row"><label class="kontaktangabe" for="vorname">Ihr Vorname*: </label><input type="text" value size="50" aria-required="true" aria-invalid="false" /></div>
<div class="table-row"><label class="kontaktangabe" for="e-mail">Ihre E-Mail*: </label><input type="text" value size="50" aria-required="true" aria-invalid="false" /></div>
<div class="table-row"><label class="kontaktangabe" for="telefon">Ihr Telefon: </label><input type="text" value size="50" aria-required="false" aria-invalid="false" /></div>
<div class="table-row" id="nachricht"><label class="kontaktangabe" for="nachricht">Ihre Nachricht: </label><textarea name="your-message" cols="52" rows="12" class="contact-form" aria-invalid="false"></textarea></div>
<div class="table-row"><label class="kontaktangabe" for="absenden"> </label><button class="buttons" type="submit" name="action" id="absenden">Absenden</button></div>
</form>
<div class="empty-bottom"> </div>
</div>
</div>
</main>
<div class="empty-bottom"> </div>
<footer>
<div class="footer">
<div class="button">Peter Schachnowskij </div>
<div class="button">Richterstr. 9 </div>
<div class="button">70567 Stuttgart </div>
<div class="button">
<nobr>Tel.: 01 76 / 21 75 17 11</nobr>
</div>
<div class="button">
<nobr>E-Mail: peter.schachnowskij.gf#gmail.com</nobr>
</div>
</div>
</footer>
</body>
</html>
Can someone please help me? Thanx in previous.