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>
Related
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.
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>
In CSS #lang-dropdown-button:focus should set pointer-events: all in #router-list , but it seems it doesn't work. The anchor doesn't navigate to the German on the dropdown. Why is that so?
*{
margin: 0px;
padding: 0px;
border:none;
}
body {
background-image: url(assets/bg.png);
background-repeat: no-repeat;
background-attachment: fixed;
}
#header {
width: 94%;
height: 50px;
border-radius: 34px;
margin: 35px 3% 0px;
background-color: rgb(255, 255, 255);
display: flex;
justify-content: space-between;
background-size: cover;
filter: drop-shadow(0px 4px 20px rgba(0, 0, 0, 0.1));
position: relative;
z-index: 100;
}
#body {
width: 94%;
height: 1000px;
margin: 35px 3% 35px;
border-radius: 25px;
background-color: rgb(255, 255, 255);
filter: drop-shadow(0px 4px 20px rgba(0, 0, 0, 0.1));
}
#logo {
align-self: center;
height: 70px;
width: 70px;
border-radius: 14px;
background-size: cover;
cursor: pointer;
}
#cont1 {
display: flex;
align-self: center;
}
#cont2 {
align-self: center;
}
#lang-dropdown {
height: fit-content;
width: fit-content;
flex-direction: column;
display: flex;
margin-right: 20px;
border-radius: 15px;
}
#elipse {
height: 10px;
width: 10px;
border-radius: 100%;
align-self: center;
background-color: #333333;
}
#title {
align-self: center;
margin-left: 10px;
display: flex;
flex-direction: row;
}
#privacy {
margin-left: 14px;
font-family: Ubuntu-Md;
font-style: normal;
line-height: 1;
font-size: 18px;
position: absolute;
align-self: center;
color: #333333;
}
#lang {
font-family: Ubuntu-Md;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 21px;
align-self: center;
color: #333333;
}
#text-container {
padding: 0px;
}
#policy-date {
font-family: Ubuntu;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 21px;
align-self: center;
color: #838383;
margin-top: 10px;
padding-left: 3.5%;
padding-bottom: 10px;
}
#text1 {
font-family: Ubuntu-Md;
font-style: normal;
font-weight: bold;
font-size: 28px;
align-self: center;
color: #333333;
padding: 3% 3% 0px;
}
#body-header {
width: 100%;
/* border-bottom: #d6d6d6 solid 1px; */
}
#globe {
color: #333333;
margin-left: 3px;
width: 25px;
height: 25px;
}
#arrow {
color: #333333;
margin-left: 1px;
margin-top: 1px;
align-self: center;
}
#lang-dropdown-button {
height: fit-content;
width: fit-content;
justify-content: space-around;
flex-direction: row;
display: flex;
background-color: rgba(255, 255, 255, 0);
cursor: pointer;
border-radius: 15px;
transition: all 0.6s ease;
width: 110px;
}
#router-list ul {
position: absolute;
background-color: #E7E7E7;
display: flex;
justify-content: space-around;
flex-direction: column;
align-items: center;
height: 35px;
width: 110px;
border-radius: 0px 0px 15px 15px;
}
#router-list li {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
transition: all 0.4s ease;
}
#last {
border-radius: 0px 0px 15px 15px;
}
#router-list {
position: relative;
z-index: 50;
opacity: 0;
transform: translateY(-10px);
transition: all 0.4s ease;
pointer-events: none;
}
#last #lang-btn {
padding-bottom: 8px;
}
#router-list li:hover {
background-color: #d4d1d1;
border-radius: 0px;
}
#router-list #last:hover {
background-color: #d4d1d1;
border-radius: inherit;
}
/* #lang-dropdown-button:focus + #lang-dropdown{
border-radius: 15px 15px 0px 0px;
} */
#lang-dropdown-button:focus {
outline: none;
background-color: #E7E7E7;
border-radius: 15px 15px 0px 0px;
}
#lang-dropdown-button:focus + #router-list {
opacity: 1;
pointer-events: all;
z-index: 200;
transform: translateY(0px);
}
#lang-dropdown-button:hover{
background-color: #d4d1d1;
}
#lang-btn {
background-color: rgba(255, 255, 255, 0);
width: 100%;
height: 100%;
font-family: Ubuntu-Md;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 21px;
text-decoration: none;
color: #333333;
display: flex;
justify-content: center;
align-items: center;
}
#lang-btn:hover {
cursor: pointer;
}
#font-face {
font-family: "Ubuntu-md";
src: url("assets/Ubuntu-Medium.ttf");
}
#font-face {
font-family: "Ubuntu";
src: url("assets/Ubuntu-Regular.ttf");
}
#media only screen and (max-width: 370px){
#privacy {
margin-right: 127px;
font-size: 16px;
}
#text1 {
font-size: 24px;
}
}
#media only screen and (max-width: 620px){
#text1 {
padding: 5% 5% 0px;
}
#policy-date {
padding: 0% 6% 10px;
}
}
#media only screen and (max-width: 325px){
#text1 {
padding: 6% 6% 0px;
}
#policy-date {
padding: 0% 7% 10px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style_v2.css" rel="stylesheet"/>
<title>Document</title>
</head>
<body>
<div id="header">
<div id="cont1">
<img id="logo" src="assets/logo.png" >
<div id ="title"><div id="elipse"></div> <div id="privacy">Privacy Policy</div> </div>
</div>
<div id="cont2">
<div id="lang-dropdown">
<button id="lang-dropdown-button" data-toggle="dropdown" >
<img id="arrow" src="assets/keyboard_arrow_down-24px 1.svg"/>
<div id="lang">English</div>
<img id="globe" src="assets/globe-24px.svg"/>
</button>
<div id="router-list" >
<ul>
<li id="last">Deutsch</li>
</ul>
</div>
</div>
</div>
</div>
<div id="box"></div>
<div id="body">
<div id="text-container">
<div id="body-header">
<div id="text1">title</div>
<div id="policy-date">Effective Date: m d, y</div>
</div>
<div></div>
</div>
</div>
</body>
</html>
i believe it has something to do with the hierarchy of the css combinators
https://www.w3schools.com/css/css_combinators.asp
i couldn't get it work either.. maybe because the combinator is acting on the div... but the links are actually li's inside a ul. thats just a guess tho.
I did however find you a work around. Switch to visibility:hidden instead of pointer-events. i tested it in VS code
it solves your hidden link being clickable thing
#router-list {
position: relative;
top: 20px;
z-index: 50;
opacity: 0;
transform: translateY(-10px);
transition: all 0.4s ease;
visibility: hidden;
/* pointer-events: none; */
}
#lang-dropdown-button:focus + #router-list {
opacity: 1;
/* pointer-events: all; */
visibility: visible;
z-index: 200;
transform: translateY(0px);
}
Just Change the
pointer-events: none; to pointer-events: all;
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.
I am building a page and I have small bug here.I can't click and hover on my button (buttons in div slide with class btn).I think a problem is in z-index or in margin on some element. But I don't know how to solve that.
Here is a page: http://project.gmwebs.cz/ .
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Cabin', sans-serif;
}
body {
background: url(img/background.jpg);
}
a {
text-decoration: none;
color: rgb(121, 0, 0);
}
h2 {
color: #F2F2F2;
}
/* Menu */
.kolecko{
width: 200px;
height: 100px;
background-color: #F2F2F2;
border-bottom-right-radius: 100px;
border-bottom-left-radius: 100px;
border: 10px solid rgb(121, 0, 0);
border-top: 0;
z-index: 3;
position: absolute;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-top: 40px;
}
.logo {
width: 160px;
z-index: 4;
position: absolute;
}
.menu-container {
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
nav {
height: 90px;
background-color: #F2F2F2;
border-bottom: 10px solid rgb(121, 0, 0);
display: flex;
flex-direction: column;
align-content: center;
justify-content: center;
}
nav ul {
display: flex;
flex-direction: row;
align-content: center;
justify-content: center;
margin: 0 100px;
}
nav ul li{
list-style-type: none;
padding: 0 20px;
text-transform: uppercase;
color: rgb(121, 0, 0);
font-size: 1.5rem;
}
nav ul li a:hover {
color: #000;
}
.toggle {
width: 100%;
padding: 15px 20px;
background: rgb(121, 0, 0);
text-align: right;
box-sizing: border-box;
color: #fff;
font-size: 2rem;
display: none;
}
.ul-list {
display: flex;
align-content: center;
justify-content: center;
flex-direction: row;
}
#link-menu {
margin-right: 10%;
}
#phone {
margin-left: 10%;
}
nav .ul-list .social-btn li:nth-child(1) {
padding-right: 0px;
}
nav .ul-list .social-btn li:nth-child(2) {
padding-left: 7px;
}
.social-btn {
display: flex;
justify-content: center;
align-content: center;
flex-direction: row;
}
i.fab.fa-facebook-square {
color: #3b5992;
}
i.fab.fa-instagram {
background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
-webkit-background-clip: text;
/* Also define standard property for compatibility */
background-clip: text;
-webkit-text-fill-color: transparent;
}
/* Slider */
.slider {
display: block;
height: 100%;
width: 100%;
z-index: -1;
background-color: #1f1f1f;
overflow: hidden;
position: absolute;
top: 0px;
right: 0px;
border-bottom: 10px solid rgb(121, 0, 0);
}
.slider > * {
position: absolute;
display: block;
width: 100%;
height: 100%;
background-color: #1f1f1f;
animation: slide 12s infinite;
overflow: hidden;
}
.slide:nth-child(1) {
left: 0%;
animation-delay: -1s;
background-image: url(img/slide1.jpg);
background-size: cover;
background-position: center;
}
.slide:nth-child(2) {
left: 100%;
animation-delay: 3s;
background-image: url(img/slide2.png);
background-size: cover;
background-position: center;
}
.slide:nth-child(3) {
left: 100%;
animation-delay: 7s;
background-image: url(img/slide3.jpg);
background-size: cover;
background-position: center;
}
.slide p {
font-size: 2rem;
text-align: center;
display: inline-block;
width: 100%;
margin-top: 350px;
color: rgb(121, 0, 0);
background: 0% 0% no-repeat padding-box;
opacity: 0.84;
backdrop-filter: blur(30px);
-webkit-backdrop-filter: blur(30px);
padding-top: 20px;
z-index: 4;
}
.slide p span {
font-size: 1.5rem;
color: #000;
}
.btn {
background-color:transparent;
border:3px solid rgb(121, 0, 0);;
display:inline-block;
cursor:pointer;
color:rgb(121, 0, 0);
font-size: 1.5rem;
padding:5px 30px;
text-decoration:none;
margin: 20px 0;
}
.btn:hover {
background-color:transparent;
color: #000;
border:3px solid #000;
}
.btn:active {
position:relative;
top:1px;
}
#keyframes slide {
0% { left: 100%; width: 100%; opacity: 1;}
6.667% { left: 0%;}
33.334% { left: 0%;}
40% { left: -100%; width: 100%; opacity: 1;}
40.0001% { left: -100%; width: 0%; opacity: 0;}
100% { left: 100%; width: 0%; opacity: 1;}
}
/* Prolog */
.prolog {
text-align: center;
color: #F2F2F2;
margin: 10%;
margin-bottom: 5%;
font-size: 1.2rem;
margin-top: 102.5vh;
}
.prolog p {
margin-top: 1rem;
}
/* Newslatters */
.newslatters {
display: flex;
align-content: center;
justify-content: center;
flex-direction: column;
text-align: center;
color: #F2F2F2;
}
.newslatters form {
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
text-align: center;
margin: 1% 35%;
margin-top: 0%;
color: #F2F2F2;
}
.newslatters p {
margin: 0.5% 0%;
font-size: 1.2rem;
}
.newslatters h2 {
font-size: 1.8rem;
}
.newslatters form input.email {
margin: 1% 0;
padding: 2% 0%;
text-align: center;
font-size: 1rem;
background-color: #F2F2F2;
}
.newslatters form input.email:active {
border: 3px solid #000;
}
.newslatters form input.submit {
margin: 1% 25%;
margin-top: 5%;
border: 3px solid rgb(121, 0, 0);
padding: 1.3% 0%;
text-align: center;
font-weight: bold;
background-color: #F2F2F2;
font-size: 1rem;
box-shadow: 5px 10px transparent;
}
.newslatters form input:hover {
border: 3px solid #000;
}
/* Footer */
footer {
border-top: 5px solid rgb(121, 0, 0);
margin-top: 2%;
}
footer .author {
padding: 0.8% 0;
text-align: center;
color: #F2F2F2;
}
footer .author a{
font-weight: bold;
color: #F2F2F2;
}
footer .author a:hover{
color: rgb(121, 0, 0);
}
i.fas.fa-heart {
color: rgb(121, 0, 0);
}
/* Media Query */
#media (max-width: 1440px) {
nav ul li{
font-size: 1.3rem;
}
nav ul {
margin: 0 50px;
}
}
#media (max-width: 1024px) {
nav ul {
margin: 0 10px;
}
nav ul li{
font-size: 1rem;
}
footer .author {
padding: 1.5% 0;
text-align: center;
color: #F2F2F2;
}
}
#media (max-width: 1023px) {
.toggle {
display: block;
}
.kolecko {
display: none;
}
.active {
display: block;
}
.ul-list {
display: flex;
align-content: center;
justify-content: center;
flex-direction: column;
margin-top: 0px;
padding-top: 0px;
}
#link-menu {
margin-right: 0%;
height: 280px;
padding-bottom: 0px;
}
#phone {
margin-left: 0%;
}
#phone li:nth-child(2) {
border-bottom: none;
padding-top: 20px;
}
#phone .social-btn li:nth-child(1) {
border-bottom: none;
padding-right: 7px;
}
#phone .social-btn li:nth-child(2){
border-bottom: none;
padding-top: 0px;
}
.social-btn {
display: flex;
justify-content: center;
align-content: center;
flex-direction: row;
}
.logo {
z-index: 1;
position: absolute;
top: -400px;
}
nav {
height: auto;
background-color: #F2F2F2;
border-bottom: 10px solid rgb(121, 0, 0);
z-index:1;
display: none;
flex-direction: column;
align-content: flex-end;
justify-content: flex-end;
align-items: center;
}
nav ul {
display: flex;
flex-direction: column;
align-content: flex-end;
justify-content: flex-end;
text-align: center;
margin: 0px 0px;
z-index: 1;
padding-bottom: 20px;
}
nav ul li{
list-style-type: none;
padding: 0px 0px;
text-transform: uppercase;
color: rgb(121, 0, 0);
font-size: 1.5rem;
line-height: 1.4;
border-bottom: 1px #000 solid;
}
nav ul li:nth-child(2) {
margin-right: 0%;
}
nav ul li:nth-child(3) {
margin-left: 0%;
}
.slide p {
margin-top: 250px;
}
.prolog {
font-size: 1rem;
}
.newslatters form {
margin: 1% 20%;
font-size: 1rem;
}
.newslatters p {
font-size: 1rem;
}
.newslatters form input.submit {
padding: 1.3% 2%;
}
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.1/css/all.css" integrity="sha384-xxzQGERXS00kBmZW/6qxqJPyxW3UR0BPsL4c8ILaIWXva5kFi7TxkIIaMiKtqV1Q" crossorigin="anonymous">
<div class="toggle">
<i class="fa fa-bars menu" aria-hidden="true"></i>
</div>
<nav>
<div class="ul-list">
<ul id="link-menu">
<li><i class="fas fa-home"></i> Domů</li>
<li><i class="fas fa-car"></i> Pronájem</li>
<li><i class="fas fa-dollar-sign"></i> Prodej</li>
</ul>
<ul id="phone">
<li><i class="fas fa-mobile-alt"></i> Kontakt</li>
<li><i class="fas fa-phone-square-alt"></i> +420 123456789</li>
<div class="social-btn">
<li><i class="fab fa-facebook-square"></i></li>
<li><i class="fab fa-instagram"></i></li>
</div>
</ul>
</div>
</nav>
<div class="menu-container">
<div class="kolecko">
</div>
<img src="css/img/logo.png" class="logo">
</div>
<div class="container">
<div class="slider">
<div class="slide">
<p>MB A35 AMG 2019 AeroPacket <br><span>Můžeš mě mít již od 4999 Kč</span><br>Pronajmout</p>
</div>
<div class="slide">
<p>Audi A7 V6T 2017 <br><span>Můžeš mě mít již od 4999 Kč</span><br>Pronajmout</p>
</div>
<div class="slide">
<p>Audi A3 2017 <br><span>Můžeš mě mít již od 4999 Kč</span><br>Pronajmout</p>
</div>
</div>
<div class="prolog">
<h1>Overcars s.r.o. - Půjčovna a prodejna luxusních automobilů</h1>
<p>Jsme malá začínající firma se zaměřením na pronájem a prodej vozů. Půjčujeme od levných vozů až po vozy luxusní! Naše vozy jsou s pravidelným servisem a ve 100% stavu. Řídíme se motem náš zákazník náš pán. Dokážeme zprostředkovat pronájem i prodej vozidel na míru.</p>
</div>
<div class="newslatters">
<h2>Chceš vědět, co se u nás děje?</h2>
<p>Přihlaš se k odběru novinek!</p>
<form action="#">
<input type="email" placeholder="Email" class="email">
<input type="submit" value="Odebírat" class="submit">
</form>
</div>
</div>
<footer>
<div class="author">
<p>Build with <i class="fas fa-heart"></i> by GMWebs</p>
</div>
</footer>
Can somebody help me please?
Thank you in advance for the advice!
It is definitely an issue with z-index.
You can simply add this CSS to your nav:
position: relative;
z-index: 1;
And remove the z-index: -1 from the .slider element.