Footer doesn't stay on bottom - html

When the width of the page gets smaller, the footer jumps "in the middle" of the page.
I tried setting position ablsolute and bottom 0 but then , it stayed in the middle all the time.
Also set html height to 100% and nothing happened. Anybody knows what's the problem?
Thanks in advance.
https://codepen.io/hmarinos/pen/QWayGWJ
* {
border-sizing: border-box;
font-family: sans-serif;
}
html {
height: 100%;
}
body {
margin: 0;
position: relative;
}
#header {
display: flex;
justify-content: space-around;
background-color: black;
position: fixed;
left: 0;
right: 0;
margin: 0 auto;
width: 75%;
padding: 8px 0;
}
img {
width: 64px;
height: 64px;
border-radius: 50%;
border-style: solid;
display: block;
margin: auto;
}
img:hover {
border-color: rgb(0, 250, 0);
}
#header-img {
display: flex;
color: white;
}
#img {
margin-right: 10px;
}
nav ul {
display: flex;
list-style: none;
}
a {
text-decoration: none;
color: white;
}
.nav-link {
padding: 0 40px;
}
.nav-link a:hover {
color: rgb(0, 250, 0);
}
#nav-bar {
align-self: center;
}
.form_container {
padding: 10px 0;
background-color: black;
}
#form {
display: flex;
justify-content: center;
height: 40px;
}
input {
padding: 8px 0;
border: none;
}
#email {
width: 400px;
padding-left: 10px;
border-radius: 4px 0 0 4px;
}
#submit {
width: 80px;
border-radius: 0 4px 4px 0;
background-color: #eee;
color: black;
font-weight: bold;
border-style: solid;
border-color: #eee;
border-width: 1px;
}
#submit:hover {
background-color: black;
color: white;
}
.main {
background-color: #eee;
width: 75%;
height: 1800px;
margin-left: auto;
margin-right: auto;
}
.column {
width: 300px;
background-color: white;
height: 500px;
border-style: solid;
border-width: 1px;
margin: 0 20px;
border-radius: 5px;
box-shadow: 0 0 10px grey;
}
.column h5 {
text-align: center;
background-color: lightgrey;
margin-top: 0;
padding: 10px 0;
}
.column h5 p {
margin-top: 5px;
margin-bottom: 0;
font-size: 18px;
}
.pricing {
height: 52%;
margin-top: -22px;
width: 80%;
margin-left: auto;
margin-right: auto;
}
.pricing_content {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
padding-top: 40px;
}
#link_one {
font-weight: bold;
font-size: 1em;
width: 45%;
padding: 10px 10px;
margin-left: auto;
margin-right: auto;
background-color: black;
border-radius: 3px;
border-style: solid;
border-width: 1px;
border-color: transparent;
}
#link_one:hover {
background-color: white;
border-style: solid;
border-width: 1px;
border-color: black;
color: black;
font-weight: bold;
}
#link_two {
color: black;
font-weight: bold;
margin-top: 25px;
background-color: #eee;
width: 45%;
padding: 10px 10px;
margin-left: auto;
margin-right: auto;
}
#link_two:hover {
background-color: lightgrey;
}
#below_button {
margin-top: 60px;
}
.plans {
display: flex;
justify-content: center;
padding-top: 100px;
}
.checks {
width: 100%;
}
.checks ul {
list-style-type: none;
}
.checks ul li:before {
content: '✓';
padding-right: 8px;
color: rgb(0, 230, 0);
}
ul li {
text-indent: -1.25em;
}
.separator {
height: 1px;
width: 80%;
margin-left: auto;
margin-right: auto;
background-color: lightgrey;
}
#media only screen and (max-width:1180px) {
.plans {
display: flex;
flex-direction: column;
align-items: center;
}
.column {
margin-bottom: 20px;
}
}
.video_container {
width: 75%;
height: 500px;
margin-left: auto;
margin-right: auto;
margin-top: 100px;
justify-content: center;
text-align: center;
}
#video {
width: 100%;
height: 600px;
}
.benefits {
width: 100%;
margin-top: 100px;
height: 300px;
}
.items {
width: 80%;
height: 300px;
margin-left: auto;
margin-right: auto;
display: flex;
align-items: center;
justify-content: center;
}
.icons {
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
}
.items i {
margin: 26px 0;
}
.icons_text {
margin-left: 10px;
}
.icons_text p {
padding: 26px 0;
}
.fa-solid {
color: rgb(0, 250, 0);
}
.footer {
width: 75%;
height: 200px;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
bottom: 0;
position: static;
}
.contact_info {
background-color: black;
width: 100%;
height: 120px;
margin: 0 auto;
display: flex;
justify-content: space-between;
}
.icons_left ul {
list-style: none;
display: flex;
margin: 0;
padding: 40px 30px;
}
.icons_left ul li {
padding: 0 40px;
color: white;
}
.contact_right {
font-size: 1.05em;
padding: 10px 30px;
color: white;
}
.footer .fa-2x:hover {
color: rgb(0, 250, 0);
}
<body>
<div class="wrap">
<div id="header">
<div id="header-img">
<img id="img" src="https://pngimg.com/uploads/gorilla/gorilla_PNG18705.png" alt="">
<h1>Gorilla Drive</h1>
</div>
<div id="nav-bar">
<nav id="links">
<ul>
<li class="nav-link">Deals</li>
<li class="nav-link">Benefits</li>
<li class="nav-link">Contact</li>
</ul>
</nav>
</div>
</div>
<div style="height:98px;"></div>
<div class="main">
<div class="plans">
<div class="column">
<h5>Basic<br>
<p>100 GB</p>
</h5>
<div class="pricing">
<div class="pricing_content">
<a id="link_one" href="#">$2,99/month</a>
<i id="below_button">Pay annualy (save 100%)</i>
<a id="link_two" href="">$20,99/year</a>
</div>
</div>
<div class="separator"></div>
<div class="checks">
<ul class="check_links">
<li>Lorem ipsum.</li>
<li>Lorem ipsum dolor.</li>
<li>Lorem ipsum dolor lahim.</li>
</ul>
</div>
</div>
<div class="column">
<h5>Standard<br>
<p>1 TB</p>
</h5>
<div class="pricing">
<div class="pricing_content">
<a id="link_one" href="#">$2,99/month</a>
<i id="below_button">Pay annualy (save 100%)</i>
<a id="link_two" href="">$20,99/year</a>
</div>
</div>
<div class="separator"></div>
<div class="checks">
<ul class="check_links">
<li>Lorem ipsum.</li>
<li>Lorem ipsum dolor.</li>
<li>Lorem ipsum dolor lahim.</li>
<li>Lorem ipsum dolor lahim baban.</li>
</ul>
</div>
</div>
<div class="column">
<h5>Premium<br>
<p>2 TB</p>
</h5>
<div class="pricing">
<div class="pricing_content">
<a id="link_one" href="#">$2,99/month</a>
<i id="below_button">Pay annualy (save 100%)</i>
<a id="link_two" href="">$20,99/year</a>
</div>
</div>
<div class="separator"></div>
<div class="checks">
<ul class="check_links">
<li>Lorem ipsum.</li>
<li>Lorem ipsum dolor.</li>
<li>Lorem ipsum dolor lahim.</li>
<li>Lorem ipsum dolor lahim baban.</li>
<li>Lorem ipsum dolor lahim baban sahim.</li>
</ul>
</div>
</div>
</div>
<div class="benefits">
<div class="items">
<div class="icons">
<i class="fa-solid fa-fire fa-3x"></i>
<i class="fa-solid fa-jet-fighter-up fa-3x"></i>
<i class="fa-solid fa-user-group fa-3x"></i>
</div>
<div class="icons_text">
<p><b>High quality!</b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis ullamcorper posuere nisi eu finibus.</p>
<p><b>Jet Fast support!</b> Proin feugiat sem tellus, commodo lacinia dui viverra ac. Sed sollicitudin non metus sed sagittis. Nunc at tincidunt magna.</p>
<p><b>Share with your family!</b> Aliquam vel mi blandit, venenatis risus vel, pellentesque nisl. Suspendisse et sem leo.</p>
</div>
</div>
</div>
<div class="video_container">
<h4>What a video!</h4>
<iframe id="video" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
<div class="footer">
<div class="form_container">
<form id="form" action="https://www.freecodecamp.com/email-submi">
<input id="email" type="email" placeholder="email">
<input id="submit" type="submit">
</form>
</div>
<div class="contact_info">
<div class="icons_left">
<ul>
<li><i class="fa-brands fa-github fa-2x"></i></li>
<li><i class="fa-brands fa-facebook fa-2x"></i></li>
<li><i class="fa-brands fa-steam fa-2x"></i></li>
<li><i class="fa-brands fa-cc-visa"></i></li>
<li><i class="fa-brands fa-cc-mastercard"></i></li>
<li><i class="fa-brands fa-cc-apple-pay"></i></li>
<li><i class="fa-brands fa-google-pay"></i></li>
<li><i class="fa-brands fa-cc-paypal"></i></li>
<li><i class="fa-brands fa-cc-amex"></i></li>
</ul>
</div>
<div class="contact_right">
<i><b>Our email:</b> <br>example#123.com</i>
<p><b>Our address:</b> <br>Catherine st. 29 New York</p>
</div>
</div>
</div>
</div>
</body>

Looks like you have an errant closing tag at the end before the closing body tag. I deleted it, and it looks like it addressed the issue.

Related

How to add logo to top left of page?

I am trying to put a logo image in the top left were SYLK is. It keeps going to the center of the page. I need the image to go where sylk is on the page. I tried just adding the img into it but it goes right to the center. Any help is much appreciated. The logo is going to act as a home button.
HTML
<!doctype html>
<html>
<head>
<title>SYLC</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" integrity="sha512-5A8nwdMOWrSz20fDsjczgUidUBR8liPYU+WymTZP1lmY9G6Oc7HlZv156XqnsgNUzTyMefFTcsFH/tnJE/+xBg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<header>
sylk
<ul>
<li>Home</li>
<li>Merch</li>
<li>Work</li>
<li>Contact</li>
</ul>
</header>
<section>
<img src="img/stars.png" id="stars">
<img src="img/moon.png" id="moon">
<img src="img/mountains_behind.png" id="mountains_behind">
<h2 id="text">Sweti Yeti</h2>
Mint Now
<img src="img/mountains_front.png" id="mountains_front">
<div class="content">
</section>
<div class="sec" id="sec">
<h2>A Collection of 9,999 Yetis</h2>
<p>A Colorful, Engaging and Inovating Community. The Sweti Yeti's, a community focused club.
</p>
<h2>Yeti Trip</h2>
<div class="container">
<div class="timeline">
<ul>
<li>
<div class="timeline-content">
<h3 class="date">20th may, 2010</h3>
<h1>Heading 1</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consectetur tempora ab laudantium voluptatibus aut eos placeat laborum, quibusdam exercitationem labore.</p>
</div>
</li>
<li>
<div class="timeline-content">
<h3 class="date">20th may, 2010</h3>
<h1>Heading 2</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consectetur tempora ab laudantium voluptatibus aut eos placeat laborum, quibusdam exercitationem labore.</p>
</div>
</li>
<li>
<div class="timeline-content">
<h3 class="date">20th may, 2010</h3>
<h1>Heading 3</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consectetur tempora ab laudantium voluptatibus aut eos placeat laborum, quibusdam exercitationem labore.</p>
</div>
</li>
<li>
<div class="timeline-content">
<h3 class="date">20th may, 2010</h3>
<h1>Heading 4</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consectetur tempora ab laudantium voluptatibus aut eos placeat laborum, quibusdam exercitationem labore.</p>
</div>
</li>
</ul>
</div>
</div>
<div class="accordion">
<div class="image-box">
<img src="imG/yeti.png" alt="Accordion Image">
</div>
<div class="accordion-text">
<div class="title">FAQ</div>
<ul class="faq-text">
<li>
<div class="question-arrow">
<span class="question">What is the total supply?</span>
<i class="bx bxs-chevron-down arrow"></i>
</div>
<p>A total of 9999 unique Sweti Yeti's will be created.</p>
<span class="line"></span>
</li>
<li>
<div class="question-arrow">
<span class="question">How Whitelist?</span>
<i class="bx bxs-chevron-down arrow"></i>
</div>
<p>Participate in our Discord Community is a supportive and consistent way.</p>
<span class="line"></span>
</li>
<li>
<div class="question-arrow">
<span class="question">Wen mint/presale?</span>
<i class="bx bxs-chevron-down arrow"></i>
</div>
<p>Pre-pre Jan 22nd, Pre Feb 12, Full Feb 14</p>
<span class="line"></span>
</li>
<li>
<div class="question-arrow">
<span class="question">What is SWETI?</span>
<i class="bx bxs-chevron-down arrow"></i>
</div>
<p>Share With Everyone To Inspire. Our goal is to make it easier for guys like us, who have big visions but little support in execution. Also relates to kid charity shtuff.</p>
<span class="line"></span>
</li>
<li>
<div class="question-arrow">
<span class="question">IMX or whatever chain stuff</span>
<i class="bx bxs-chevron-down arrow"></i>
</div>
<p>bleh</p>
<span class="line"></span>
</li>
<li>
<div class="question-arrow">
<span class="question"> How to bother you?</span>
<i class="bx bxs-chevron-down arrow"></i>
</div>
<p>Insert contact info</p>
<span class="line"></span>
</li>
</ul>
</div>
</div>
</div class="sec">
<script type="text/javascript">
let moon = document.getElementById('moon');
let stars = document.getElementById('stars');
let mountains_behind = document.getElementById('mountains_behind');
let mountains_front = document.getElementById('mountains_front');
let text = document.getElementById('text');
let btn = document.getElementById('btn');
let header = document.querySelector('header');
window.addEventListener('scroll', function() {
var value = window.scrollY;
moon.style.top = -value * -1.05 + 'px';
stars.style.left = value * 0.25 + 'px';
mountains_behind.style.top =-value * -0.5 + 'px';
header.style.top =-value * -0.5 + 'px';
mountains_front.style.top =-value * 0 + 'px';
text.style.marginTop = value * 1.5 + 'px';
btn.style.marginTop = value * 1.5 + 'px';
text.style.marginRight = value * 4 + 'px';
});
</script>
<script>
let li = document.querySelectorAll(".faq-text li");
for (var i = 0; i < li.length; i++) {
li[i].addEventListener("click", (e)=>{
let clickedLi;
if(e.target.classList.contains("question-arrow")){
clickedLi = e.target.parentElement;
}else{
clickedLi = e.target.parentElement.parentElement;
}
clickedLi.classList.toggle("showAnswer");
});
}
</script>
CSS
#import url("https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
scroll-behavior: smooth;
}
body {
background: linear-gradient(#2b1055, #7597de);
}
section {
position: relative;
width: 100%;
height: 100vh;
padding: 100px;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
header {
position: absolute;
top: 0;
left: 0;
width: 100%;
padding: 30px 100px;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 1000;
}
header .logo {
color: #fff;
font-weight: 700;
text-decoration: none;
font-size: 2em;
text-transform: uppercase;
letter-spacing: 2px;
}
header ul {
display: flex;
justify-content: center;
align-items: center;
}
header ul li {
list-style: none;
margin-left: 20px;
}
header ul li a {
text-decoration: none;
padding: 6px 15px;
color: #fff;
border-radius: 20px;
}
header ul li a.active,
header ul li a:hover {
background: #fff;
color: #2b1055;
}
section:before {
content: "";
position: absolute;
bottom: 0;
width: 100%;
height: 100px;
background: linear-gradient(to top, #1c0522, transparent);
z-index: 1000;
}
section img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
pointer-events: none;
}
section img#moon {
mix-blend-mode: screen;
}
section img#mountains_front {
z-index: 10;
}
h2#text {
position: absolute;
color: #fff;
right: -350px;
white-space: nowrap;
font-size: 7.5vw;
transform: translateY(0px);
}
#btn {
text-decoration: none;
padding: 8px 30px;
border-radius: 40px;
background: #fff;
color: #2b1055;
transform: translateY(100px);
font-size: 1.5em;
z-index: 9;
}
.sec {
position: relative;
min-height: 500px;
padding: 100px;
background: #1c0522;
}
.sec h2 {
font-size: 3.5em;
margin-bottom: 10px;
color: #fff;
text-align: center;
}
.sec p {
font-size: 1.2em;
color: #fff;
}
::selection {
background: #7d2ae8;
color: #fff;
}
.accordion {
display: flex;
max-width: 1010px;
width: 100%;
align-items: center;
justify-content: space-between;
background: #fff;
border-radius: 25px;
padding: 45px 90px 45px 60px;
margin: 0 auto;
}
.accordion .image-box {
height: 360px;
width: 300px;
}
.accordion .image-box img {
height: 100%;
width: 100%;
object-fit: contain;
}
.accordion .accordion-text {
width: 60%;
}
.accordion .accordion-text .title {
font-size: 35px;
font-weight: 600;
color: #7d2ae8;
font-family: "Fira Sans", sans-serif;
}
.accordion .accordion-text .faq-text {
margin-top: 25px;
height: 263px;
overflow-y: auto;
}
.faq-text::-webkit-scrollbar {
display: none;
}
.accordion .accordion-text li {
list-style: none;
cursor: pointer;
}
.accordion-text li .question-arrow {
display: flex;
align-items: center;
justify-content: space-between;
}
.accordion-text li .question-arrow .question {
font-size: 18px;
font-weight: 500;
color: #595959;
transition: all 0.3s ease;
}
.accordion-text li .question-arrow .arrow {
font-size: 20px;
color: #595959;
transition: all 0.3s ease;
}
.accordion-text li.showAnswer .question-arrow .arrow {
transform: rotate(-180deg);
}
.accordion-text li:hover .question-arrow .question,
.accordion-text li:hover .question-arrow .arrow {
color: #7d2ae8;
}
.accordion-text li.showAnswer .question-arrow .question,
.accordion-text li.showAnswer .question-arrow .arrow {
color: #7d2ae8;
}
.accordion-text li .line {
display: block;
height: 2px;
width: 100%;
margin: 10px 0;
background: rgba(0, 0, 0, 0.1);
}
.accordion-text li p {
width: 92%;
font-size: 15px;
font-weight: 500;
color: #595959;
display: none;
}
.accordion-text li.showAnswer p {
display: block;
}
#media (max-width: 994px) {
body {
padding: 40px 20px;
}
.accordion {
max-width: 100%;
padding: 45px 60px 45px 60px;
}
.accordion .image-box {
height: 360px;
width: 220px;
}
.accordion .accordion-text {
width: 63%;
}
}
#media (max-width: 820px) {
.accordion {
flex-direction: column;
}
.accordion .image-box {
height: 360px;
width: 300px;
background: #ffffff;
width: 100%;
border-radius: 25px;
padding: 30px;
}
.accordion .accordion-text {
width: 100%;
margin-top: 30px;
}
}
#media (max-width: 538px) {
.accordion {
padding: 25px;
}
.accordion-text li p {
width: 98%;
}
}
#import url("https://fonts.googleapis.com/css2?family=Montserrat:wght#300;500&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-family: "Montserrat";
}
.container {
min-height: 100vh;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 100px 0;
background-color: #1c0522;
}
.timeline {
width: 80%;
height: auto;
max-width: 800px;
margin: 0 auto;
position: relative;
}
.timeline ul {
list-style: none;
}
.timeline ul li {
padding: 20px;
background-color: #655ee1;
color: white;
border-radius: 10px;
margin-bottom: 20px;
}
.timeline ul li:last-child {
margin-bottom: 0;
}
.timeline-content h1 {
font-weight: 500;
font-size: 25px;
line-height: 30px;
margin-bottom: 10px;
}
.timeline-content p {
font-size: 16px;
line-height: 30px;
font-weight: 300;
}
.timeline-content .date {
font-size: 12px;
font-weight: 300;
margin-bottom: 10px;
letter-spacing: 2px;
}
#media only screen and (min-width: 768px) {
.timeline:before {
content: "";
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 2px;
height: 100%;
background-color: gray;
}
.timeline ul li {
width: 50%;
position: relative;
margin-bottom: 50px;
}
.timeline ul li:nth-child(odd) {
float: left;
clear: right;
transform: translateX(-30px);
border-radius: 20px 0px 20px 20px;
}
.timeline ul li:nth-child(even) {
float: right;
clear: left;
transform: translateX(30px);
border-radius: 0px 20px 20px 20px;
}
.timeline ul li::before {
content: "";
position: absolute;
height: 20px;
width: 20px;
border-radius: 50%;
background-color: gray;
top: 0px;
}
.timeline ul li:nth-child(odd)::before {
transform: translate(50%, -50%);
right: -30px;
}
.timeline ul li:nth-child(even)::before {
transform: translate(-50%, -50%);
left: -30px;
}
.timeline-content .date {
position: absolute;
top: -30px;
}
.timeline ul li:hover::before {
background-color: aqua;
}
}
Thanks in advance for any and all help.
Try adding to the header .logoclass
float:left;
margin-top:0;
I copied your code and added a small image I had that is only about 75x39 pixels respectively and it shows even with your menu and about 2" in on my monitor. It's not dead left on my laptop monitor but it should be in the ball park. I add a a bigger image 246x205 and it looks okay.
One thing I noticed when I copied your html and css down, I can't see your entire page. You man need some other modifications. The Mint Now is centered.
header .logo {
color: #fff;
font-weight: 700;
text-decoration: none;
font-size: 2em;
text-transform: uppercase;
letter-spacing: 2px;
float:left;
margin-top:0;
position:fixed;
}
Note: I also added a position-fixed at the bottom. This will scroll your logo with the page. If you don't want to do that with your page, just remove the position tag.
If your logo still goes to the center, you may have something else conflicting with the positioning. I just used these two files you posted here.
<header>
<img src="sam.jpg">

Top navigation that's set as fixed on top not behaving correctly

I set the top navigation bar as being sticky on top, but it's acting weird in some places.
Here's the fiddle link https://jsfiddle.net/benjaminana77/pugek2f8/30/ and I reproduced code below.
I'm having problems in three places
In the hero image section, top nav background is incorrectly being transparent. I set the background color as white, not transparent.
The top nav bar incorrectly shows BEHIND a slider, not above the slider.
When you hover over an item in the grid layout, the item shows above the top nav bar.
normal state:
when you hover over an image:
Many thanks in advance!
HTML:
<div class="boxA">
<div class="box1">
<div class="site">
<img src="img/logo.png">
</div>
</div>
<div class="box2">
<nav class="menu">
<ul>
<li>menu1</li>
<li>menu2</li>
<li>menu3</li>
<li>menu4</li>
</ul>
</nav>
</div>
</div>
<div class="body-part">
<section class="conA">
<div id="container">
<div id="heroText">
<p>Lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercit</p>
<div id="text"></div>
</div>
<div id="images"></div>
</div>
</section>
<ul class="slider" style="padding:0px !important;">
<li><img src="img/sample.png">
<div class="caption1">caption 1</div>
</li>
<li> <img src="img/Group 3.png">
<div class="caption2"></div>
<div class="caption3">caption 2</div>
<div class="caption5">caption 3</div>
<div class="caption4">caption 4</div>
</li>
</ul>
<section id="conD">
<div class="container">
<div class="grid menu-content" id="menu1-content">
<article>
<a href="#">
<div class="photo" style="background-image: url(https://www.gravatar.com/avatar/a235706e3d81b614acaec3368edfea4b?s=96&d=identicon&r=PG);"></div>
<div class="text">
<h3>Title </h3>
<p>Lorem ipsum dolor </p>
</div>
</a>
</article>
<article>
<a href="#">
<div class="photo" style="background-image: url(img/sample.jpg);"></div>
<div class="text">
<h3>Headingg</h3>
<p>Lorem ipsum dolor </p>
</div>
</a>
</article>
<article>
<a href="#">
<div class="photo" style="background-image: url(img/sample.jpg);"></div>
<div class="text">
<h3>Headingg</h3>
<p>Lorem ipsum dolor </p>
</div>
</a>
</article>
</div>
</div>
</section>
CSS:
.boxA:after {
content:"";
display: block;
clear: both;
}
.boxA {
height: 90px;
position: fixed;
border-bottom: 1px solid #E0DCDC;
top: 0;
width: 100%;
background-color: white;
max-width: 1440px;
}
.boxA img {
position: absolute;
top: 50%;
left: 3%;
transform: translate(0, -50%);
}
.box2 ul {
position: absolute;
top: 50%;
transform: translate(0, -50%);
right: 10px;
}
.box1 {
float: left;
width: auto;
}
.box2 {
float: right;
width: auto;
}
.box2 ul {
margin: 0;
padding: 0;
list-style: none;
}
.box2 li a {
display: block;
padding: 0px 50px;
color: inherit;
text-decoration: none;
font-size: 12px;
}
.box2 li a:hover {
text-decoration: underline;
}
.box2 ul:after {
content: "";
display: block;
clear: both;
}
.box2 li {
float: left;
width: auto;
font-family: 'Gotham';
letter-spacing: 2.5px;
}
.box1 img {
position: absolute;
width: 20%;
height: auto;
}
#top-logo {
margin-top: 40px;
}
#top-logo img {
display: block;
margin-left: auto;
margin-right: auto;
width: 20%;
height: auto;
}
body {
font-family: gotham;
margin: 0px !important;
color: #827F88;
letter-spacing: 0.4px;
line-height: 1.9;
}
.conA {
height: 100vh;
display: flex;
position: relative;
}
.conA #container {
margin: 0;
display: flex;
align-items: flex-start;
position: absolute;
top: 50%;
left: 10%;
transform: translate(0%, -50%);
}
#heroText {
font-size: 37px;
color: #56525E;
line-height: 1 !important;
}
.conA #heroText {
height: 400px;
padding-top: 100px;
}
#conD ul {
margin: 0 0 30px -30px;
padding: 0;
list-style: none;
}
#conD li {
padding: 35px;
display: block;
text-decoration: none;
font-size: 15.5px;
letter-spacing: 2px;
color: inherit;
}
#conD li {
float: left;
width: auto;
}
#conD ul:after {
content:"";
display: block;
clear: both;
}
#conD .menu {
margin-bottom: 20px
}
.grid {
display: grid;
justify-content: start;
margin-top: -20px;
}
.grid .photo {
width: 100%;
background-size: contain;
background-position: center;
}
.grid .photo:after {
content: "";
display: block;
padding-bottom: 100%;
}
.grid a {
display: block;
text-decoration: none;
color: inherit;
}
.grid a:hover {
opacity: 0.8;
}
JQUERY:
$(document).ready(function(){
      $('.slider').bxSlider({
auto: true,
pause: 3000,
mode: 'fade',
speed: 1200,
pager: false
});
    });
(function ($) {
$(document).ready(function(){
// hide .navbar first
$(".boxA").hide();
// fade in .navbar
$(function () {
$(window).scroll(function () {
// set distance user needs to scroll before we start fadeIn
if ($(this).scrollTop() > 50) {
$('.boxA').fadeIn();
$('#top-logo').fadeOut();
} else {
$('.boxA').fadeOut();
$('#top-logo').fadeIn();
}
});
});
});
}(jQuery));
Add z-index:2 on .boxA
.boxA {
height: 90px;
position: fixed;
border-bottom: 1px solid #E0DCDC;
top: 0;
width: 100%;
background-color: white;
max-width: 1440px;
z-index: 2;
}
.body-part{
position: relative;
z-index: 1;
}
https://jsfiddle.net/lalji1051/24rm0yvt/
updated link - https://jsfiddle.net/lalji1051/24rm0yvt/3/

Scrolling a little below actual element

I am creating a demo page and it is almost ready.
Here is the codepen link of it. https://codepen.io/kamalpancholi/full/wvGMgEK?editors=1100
But I am facing two issues.
[1] When I click on the navbar link, the page scrolls a little below the actual element. Results in some of the actual content goes below header. I am using sticky header.
[2] I don't understand why I need to use so many !important in CSS media queries ? Am I doing something wrong in media queries ? The value provided in media query was never updated until I used !important with it.
Below is the code
#import url('https://fonts.googleapis.com/css2?family=Oswald&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Ubuntu&display=swap');
* {margin: 0; padding: 0;}
body{ font-family: 'oswald', sans-serif}
.text-center { text-align: center; }
.text-left { text-align: center; }
.block { display: block; }
.inline { display: inline; }
.bold { font-weight: bold; }
.no-decor-link {
text-decoration: none;
color: black;
}
.no-bullets { list-style-type: none; }
.orangered { color: orangered; }
.ubuntu { font-family: 'Ubuntu', sans-serif }
.oswald { font-family: 'Oswald', sans-serif }
#header {
background-color: #FFDEAD;
position: sticky;
top: 0;
z-index: 2;
}
#logoNtitle {
display: inline-block;
}
#header-img {
width: 80px;
height: auto;
margin: 1em auto 0.7em 10vw;
}
#header-text{
position: relative;
top: -14px;
font-size: 2em;
margin-left: 0.8em;
}
#nav-bar {
float: right;
position: relative;
top: 2.3em;
right: 2em;
font-family: 'Ubuntu', sans-serif;
}
#nav-bar a{
padding: 1em 0.5em 1em 0.5em;
}
#main {
width: 1020px;
margin: auto;
background-color: #e6e6e6;
padding: 0.05px; /* to avoid margin collapsing */
}
#main p {
margin: 1em;
}
#media(max-width: 1020px) {
#main { width: 800px; }
#video {
width: 500px !important;
height: 281.25px !important;
}
#demo {
margin: 1em auto 3em !important;
}
}
#media(max-width: 800px) {
#main { width: 100%; }
#features-1 .ico { display: none !important; }
#features-1 { width: 80% !important; }
#nav-bar {
float: none;
position: initial;
text-align: center;
padding-bottom: 1em;
}
#logoNtitle {
display: block;
width: 320px;
margin: auto;
}
#header-img {
margin-left: auto;
}
#demo {
margin-top: 1em !important;
margin-bottom: 1em !important;
}
#pricing { margin-bottom: 1.2em; }
#pricing-content {
display: initial !important;
padding: 0.05px;
margin: 1em auto !important;
}
.card {
width: 300px;
margin: 1em auto 0.5em;
}
}
#media(max-width: 550px) {
#video {
width: 90vw !important;
height: 50.625vw !important;
}
}
#email {
display: block;
margin: 1em auto 1em auto;
border-radius: 3px;
border: 2px solid black;
padding: 0.3em 7px 0.3em 7px;
color: #1b2b34;
min-width: 15em;
}
#submit {
display: block;
margin: auto auto 1em auto;
background-color: #5fce6a;
border: none;/*1px solid grey;*/
padding: 0.5em 1em;
font-size: 1em;
}
#features-1{
width: 50%;
margin: 3em auto 2em;
}
.flex {
display: flex;
flex-direction: row;
}
#features-1 .ico {
display: flex;
height: 100px;
width: 90px;
justify-content: center;
align-items: center;
color: orangered;
}
#features-1 .content {
display: flex;
flex-direction: column;
justify-content: center;
height: 100px;
width: 75vw;
padding-left: 30px;
padding-right: 10px;
}
#features-2 {
margin: auto;
display: flex;
flex-direction: column;
}
#features-2 ul {
list-style-type: none;
line-height: 2em;
margin: auto;
}
#features-2 .feature-title {
font-size: 1.2em;
margin: 1% auto;
}
#features ul li:before {
content: '\2713';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
#demo {
margin: 2em auto 3em;
}
#video-title {
text-align: center;
padding: 1em;
font-family: 'ubuntu', sans-serif;
}
#video {
display: block;
width: 729px;
height: 410px;
margin: auto;
}
#pricing-content {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 1.3em;
width: 95%;
margin: 2em auto;
}
.card {
border: 2px solid black;
text-align: center;
}
.card h3 {
background-color: #BDBBBB;
padding: 0.5em 1em;
}
.card h2 {
font-weight: bold;
line-height: 2em;
}
.card ul {
line-height: 2em;
font-family: 'ubuntu';
}
.card button {
padding: 0.5em 2.3em;
margin: 1em auto;
background-color: orangered;
border: none;
font-family: 'ubuntu';
font-weight: bold;
}
.true:before {
content: '\2713';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
.false:before {
content: '\2717';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
footer div {
background-color: #BDBBBB;
font-family: 'ubuntu';
padding: 0.05px;
}
footer ul {
padding-top: 1.3em;
padding-bottom: 0.5em;
}
footer li {
display: inline;
padding-left: 1em;
padding-right: 1em;
}
.footer-content p {
margin-top: 0px !important;
font-size: 13px;
}
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - Product page</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css'><link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<header id="header">
<div id="logoNtitle">
<img src="https://www.freepnglogos.com/uploads/eagles-png-logo/eagle-sports-png-logos--0.png" alt="product logo" id="header-img" class="inline">
<span id="header-text">The Lorem Ipsum</span>
</div>
<nav id="nav-bar">
<div id="links">
<span>Features</span>
<span>Demo</span>
<span>Pricing</span>
<span>Contact Us!</span>
</div>
</nav>
</header>
<div id="main">
<p class="text-center ubuntu pclass"> Provide your email for more information about product </p>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<label for="email">
<input type="email" id="email" name="email" placeholder="Enter your email address">
</label>
<input type="submit" value="Submit" id="submit">
</form>
<div id="features" class="ubuntu">
<div id="features-1">
<div class="flex">
<div class="ico"><i class="fas fa-air-freshener fa-2x"></i></div>
<div class="content">
<h3>Premium quality material</h3>
<span>Lorem ipsum dolor sit amat, consecite adispicing elit, ipsum dolor sit amat, consecite adispicing elit</span>
</div>
</div>
<div class="flex">
<div class="ico"><i class="fas fa-shipping-fast fa-2x"></i></div>
<div class="content">
<h3>Fast shipping</h3>
<span>Lorem ipsum amat, dolorem ipsum</span>
</div>
</div>
<div class="flex">
<div class="ico"><i class="fas fa-user-clock fa-2x"></i></div>
<div class="content">
<h3>Timely maintenance updates</h3>
<span>Lorem ipsum dolor sit amat, consecite adispicing elit</span>
</div>
</div>
</div>
<div id="features-2">
<p class="bold feature-title">Why to choose us ?</p>
<ul> <!-- use css list-style-type: none; to remove bullets
use list-style-image: url(img.png) to use an image as bullet -->
<li>Lorem ipsum dolor</li>
<li>sit amet, consectetur adipiscing elit</li>
<li>Nunc tempor</li>
<li>dolorem ipsum quia</li>
<li>Lorem ipsum dolor</li>
<li>sit amet, consectetur adipiscing elit</li>
<li>Nunc tempor</li>
<li>dolorem ipsum quia</li>
</ul>
</div>
</div>
<div id="demo">
<h2 id="video-title">Here is how it works !!!</h2>
<div class="video-container">
<iframe width="729" height="410" id="video" src="https://www.youtube.com/embed/CmzKQ3PSrow" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div id="pricing">
<div id="pricing-content">
<div class="card">
<h3>Basic Package</h3>
<h2>$500</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="false">Dolor sit, amat</li>
<li class="false">Nunc tempor</li>
<li class="false">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
<div class="card">
<h3>Premium Package</h3>
<h2>$600</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="true">Dolor sit, amat</li>
<li class="false">Nunc tempor</li>
<li class="false">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
<div class="card">
<h3>Pro Package</h3>
<h2>$800</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="true">Dolor sit, amat</li>
<li class="true">Nunc tempor</li>
<li class="true">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
</div>
</div>
<footer id="contact">
<div class="footer-content">
<ul class="no-bullets">
<li>Privacy</li>
<li>Terms</li>
<li>Contact</li>
</ul>
<p>&copyThe Lorem Ipsum</p>
</div>
</footer>
</div>
<!-- partial -->
<script src='https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js'></script>
</body>
</html>
I've added padding-top: 75px; and padding-top: 40px; to the page anchors to give it the buffer you are looking for.
#import url('https://fonts.googleapis.com/css2?family=Oswald&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Ubuntu&display=swap');
* {
margin: 0;
padding: 0;
}
body {
font-family: 'oswald', sans-serif
}
.text-center,
.text-left {
text-align: center;
}
.block {
display: block;
}
.inline {
display: inline;
}
.bold {
font-weight: bold;
}
.no-decor-link {
text-decoration: none;
color: black;
}
.no-bullets {
list-style-type: none;
}
.orangered {
color: orangered;
}
.ubuntu {
font-family: 'Ubuntu', sans-serif;
}
#features {
padding-top: 40px;
}
#demo {
padding-top: 75px;
}
.oswald {
font-family: 'Oswald', sans-serif
}
#header {
background-color: #FFDEAD;
position: sticky;
top: 0;
z-index: 2;
}
#logoNtitle {
display: inline-block;
}
#header-img {
width: 80px;
height: auto;
margin: 1em auto 0.7em 10vw;
}
#header-text {
position: relative;
top: -14px;
font-size: 2em;
margin-left: 0.8em;
}
#nav-bar {
float: right;
position: relative;
top: 2.3em;
right: 2em;
font-family: 'Ubuntu', sans-serif;
}
#nav-bar a {
padding: 1em 0.5em 1em 0.5em;
}
#main {
width: 1020px;
margin: auto;
background-color: #e6e6e6;
padding: 0.05px;
/* to avoid margin collapsing */
}
#main p {
margin: 1em;
}
#media(max-width: 1020px) {
#main {
width: 800px;
}
#video {
width: 500px !important;
height: 281.25px !important;
}
#demo {
margin: 1em auto 3em !important;
}
}
#media(max-width: 800px) {
#main {
width: 100%;
}
#features-1 .ico {
display: none !important;
}
#features-1 {
width: 80% !important;
}
#nav-bar {
float: none;
position: initial;
text-align: center;
padding-bottom: 1em;
}
#logoNtitle {
display: block;
width: 320px;
margin: auto;
}
#header-img {
margin-left: auto;
}
#demo {
margin-top: 1em !important;
margin-bottom: 1em !important;
}
#pricing {
margin-bottom: 1.2em;
}
#pricing-content {
display: initial !important;
padding: 0.05px;
margin: 1em auto !important;
}
.card {
width: 300px;
margin: 1em auto 0.5em;
}
}
#media(max-width: 550px) {
#video {
width: 90vw !important;
height: 50.625vw !important;
}
}
#email {
display: block;
margin: 1em auto 1em auto;
border-radius: 3px;
border: 2px solid black;
padding: 0.3em 7px 0.3em 7px;
color: #1b2b34;
min-width: 15em;
}
#submit {
display: block;
margin: auto auto 1em auto;
background-color: #5fce6a;
border: none;
/*1px solid grey;*/
padding: 0.5em 1em;
font-size: 1em;
}
#features-1 {
width: 50%;
margin: 3em auto 2em;
}
.flex {
display: flex;
flex-direction: row;
}
#features-1 .ico {
display: flex;
height: 100px;
width: 90px;
justify-content: center;
align-items: center;
color: orangered;
}
#features-1 .content {
display: flex;
flex-direction: column;
justify-content: center;
height: 100px;
width: 75vw;
padding-left: 30px;
padding-right: 10px;
}
#features-2 {
margin: auto;
display: flex;
flex-direction: column;
}
#features-2 ul {
list-style-type: none;
line-height: 2em;
margin: auto;
}
#features-2 .feature-title {
font-size: 1.2em;
margin: 1% auto;
}
#features ul li:before {
content: '\2713';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
#demo {
margin: 2em auto 3em;
padding-top: 75px;
}
#video-title {
text-align: center;
padding: 1em;
font-family: 'ubuntu', sans-serif;
}
#video {
display: block;
width: 729px;
height: 410px;
margin: auto;
}
#pricing-content {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 1.3em;
width: 95%;
margin: 2em auto;
}
.card {
border: 2px solid black;
text-align: center;
}
.card h3 {
background-color: #BDBBBB;
padding: 0.5em 1em;
}
.card h2 {
font-weight: bold;
line-height: 2em;
}
.card ul {
line-height: 2em;
font-family: 'ubuntu';
}
.card button {
padding: 0.5em 2.3em;
margin: 1em auto;
background-color: orangered;
border: none;
font-family: 'ubuntu';
font-weight: bold;
}
.true:before {
content: '\2713';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
.false:before {
content: '\2717';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
footer div {
background-color: #BDBBBB;
font-family: 'ubuntu';
padding: 0.05px;
}
footer ul {
padding-top: 1.3em;
padding-bottom: 0.5em;
}
footer li {
display: inline;
padding-left: 1em;
padding-right: 1em;
}
.footer-content p {
margin-top: 0px !important;
font-size: 13px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CodePen - Product page</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css'>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<header id="header">
<div id="logoNtitle">
<img src="https://www.freepnglogos.com/uploads/eagles-png-logo/eagle-sports-png-logos--0.png" alt="product logo" id="header-img" class="inline">
<span id="header-text">The Lorem Ipsum</span>
</div>
<nav id="nav-bar">
<div id="links">
<span>Features</span>
<span>Demo</span>
<span>Pricing</span>
<span>Contact Us!</span>
</div>
</nav>
</header>
<div id="main">
<p class="text-center ubuntu pclass"> Provide your email for more information about product </p>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<label for="email">
<input type="email" id="email" name="email" placeholder="Enter your email address">
</label>
<input type="submit" value="Submit" id="submit">
</form>
<div id="features" class="ubuntu">
<div id="features-1">
<div class="flex">
<div class="ico"><i class="fas fa-air-freshener fa-2x"></i></div>
<div class="content">
<h3>Premium quality material</h3>
<span>Lorem ipsum dolor sit amat, consecite adispicing elit, ipsum dolor sit amat, consecite adispicing elit</span>
</div>
</div>
<div class="flex">
<div class="ico"><i class="fas fa-shipping-fast fa-2x"></i></div>
<div class="content">
<h3>Fast shipping</h3>
<span>Lorem ipsum amat, dolorem ipsum</span>
</div>
</div>
<div class="flex">
<div class="ico"><i class="fas fa-user-clock fa-2x"></i></div>
<div class="content">
<h3>Timely maintenance updates</h3>
<span>Lorem ipsum dolor sit amat, consecite adispicing elit</span>
</div>
</div>
</div>
<div id="features-2">
<p class="bold feature-title">Why to choose us ?</p>
<ul>
<!-- use css list-style-type: none; to remove bullets
use list-style-image: url(img.png) to use an image as bullet -->
<li>Lorem ipsum dolor</li>
<li>sit amet, consectetur adipiscing elit</li>
<li>Nunc tempor</li>
<li>dolorem ipsum quia</li>
<li>Lorem ipsum dolor</li>
<li>sit amet, consectetur adipiscing elit</li>
<li>Nunc tempor</li>
<li>dolorem ipsum quia</li>
</ul>
</div>
</div>
<div id="demo">
<h2 id="video-title">Here is how it works !!!</h2>
<div class="video-container">
<iframe width="729" height="410" id="video" src="https://www.youtube.com/embed/CmzKQ3PSrow" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div id="pricing">
<div id="pricing-content">
<div class="card">
<h3>Basic Package</h3>
<h2>$500</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="false">Dolor sit, amat</li>
<li class="false">Nunc tempor</li>
<li class="false">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
<div class="card">
<h3>Premium Package</h3>
<h2>$600</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="true">Dolor sit, amat</li>
<li class="false">Nunc tempor</li>
<li class="false">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
<div class="card">
<h3>Pro Package</h3>
<h2>$800</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="true">Dolor sit, amat</li>
<li class="true">Nunc tempor</li>
<li class="true">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
</div>
</div>
<footer id="contact">
<div class="footer-content">
<ul class="no-bullets">
<li>Privacy</li>
<li>Terms</li>
<li>Contact</li>
</ul>
<p>&copyThe Lorem Ipsum</p>
</div>
</footer>
</div>
<script src='https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js'></script>
</body>
</html>
1. Anchors behind fixed nav
To prevent the anchors starting at the top of the page and therefore being hidden behind your fixed nav, you can add padding to them so that the padding is hidden under the nav instead. Of course this means that you will also have a bigger space in the page itself that you may not want.
To counteract that, you can add a negative value for the margin to pull the top of the element back up.
#features, #demo, #pricing, #contact {
margin-top: -100px;
padding-top: 100px;
}
2. Use of !important in all media queries
The reason you found that you had to use !important in your media queries is because you have included the media queries before the default CSS for those elements -this means that the rules in your media queries are being overridden by the CSS underneath them. Just move your media queries to the end and you can remove the !importants.
Working Example:
See example below with both of these changes made:
#import url('https://fonts.googleapis.com/css2?family=Oswald&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Ubuntu&display=swap');
* {margin: 0; padding: 0;}
body{ font-family: 'oswald', sans-serif}
.text-center { text-align: center; }
.text-left { text-align: center; }
.block { display: block; }
.inline { display: inline; }
.bold { font-weight: bold; }
.no-decor-link {
text-decoration: none;
color: black;
}
.no-bullets { list-style-type: none; }
.orangered { color: orangered; }
.ubuntu { font-family: 'Ubuntu', sans-serif }
.oswald { font-family: 'Oswald', sans-serif }
#header {
background-color: #FFDEAD;
position: sticky;
top: 0;
z-index: 2;
}
#logoNtitle {
display: inline-block;
}
#header-img {
width: 80px;
height: auto;
margin: 1em auto 0.7em 10vw;
}
#header-text{
position: relative;
top: -14px;
font-size: 2em;
margin-left: 0.8em;
}
#nav-bar {
float: right;
position: relative;
top: 2.3em;
right: 2em;
font-family: 'Ubuntu', sans-serif;
}
#nav-bar a{
padding: 1em 0.5em 1em 0.5em;
}
#main {
width: 1020px;
margin: auto;
background-color: #e6e6e6;
padding: 0.05px; /* to avoid margin collapsing */
}
#main p {
margin: 1em;
}
#email {
display: block;
margin: 1em auto 1em auto;
border-radius: 3px;
border: 2px solid black;
padding: 0.3em 7px 0.3em 7px;
color: #1b2b34;
min-width: 15em;
}
#submit {
display: block;
margin: auto auto 1em auto;
background-color: #5fce6a;
border: none;/*1px solid grey;*/
padding: 0.5em 1em;
font-size: 1em;
}
#features-1{
width: 50%;
margin: 3em auto 2em;
}
.flex {
display: flex;
flex-direction: row;
}
#features-1 .ico {
display: flex;
height: 100px;
width: 90px;
justify-content: center;
align-items: center;
color: orangered;
}
#features-1 .content {
display: flex;
flex-direction: column;
justify-content: center;
height: 100px;
width: 75vw;
padding-left: 30px;
padding-right: 10px;
}
#features-2 {
margin: auto;
display: flex;
flex-direction: column;
}
#features-2 ul {
list-style-type: none;
line-height: 2em;
margin: auto;
}
#features-2 .feature-title {
font-size: 1.2em;
margin: 1% auto;
}
#features ul li:before {
content: '\2713';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
#demo {
margin: 2em auto 2em;
}
#video-title {
text-align: center;
padding: 1em;
font-family: 'ubuntu', sans-serif;
}
#video {
display: block;
width: 729px;
height: 410px;
margin: auto;
}
#pricing-content {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 1.3em;
width: 95%;
margin: 2em auto;
}
.card {
border: 2px solid black;
text-align: center;
}
.card h3 {
background-color: #BDBBBB;
padding: 0.5em 1em;
}
.card h2 {
font-weight: bold;
line-height: 2em;
}
.card ul {
line-height: 2em;
font-family: 'ubuntu';
}
.card button {
padding: 0.5em 2.3em;
margin: 1em auto;
background-color: orangered;
border: none;
font-family: 'ubuntu';
font-weight: bold;
}
.true:before {
content: '\2713';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
.false:before {
content: '\2717';
display: inline-block;
position: relative;
right: 6px;
font-weight: bold;
}
footer div {
background-color: #BDBBBB;
font-family: 'ubuntu';
padding: 0.05px;
}
footer ul {
padding-top: 1.3em;
padding-bottom: 0.5em;
}
footer li {
display: inline;
padding-left: 1em;
padding-right: 1em;
}
.footer-content p {
margin-top: 0px;
font-size: 13px;
}
#media(max-width: 1020px) {
#main { width: 800px; }
#video {
width: 500px;
height: 281.25px;
}
#demo {
margin: 1em auto 3em;
}
}
#media(max-width: 800px) {
#main { width: 100%; }
#features-1 .ico { display: none; }
#features-1 { width: 80%; }
#nav-bar {
float: none;
position: initial;
text-align: center;
padding-bottom: 1em;
}
#logoNtitle {
display: block;
width: 320px;
margin: auto;
}
#header-img {
margin-left: auto;
}
#demo {
margin-top: 1em;
margin-bottom: 1em;
}
#pricing { margin-bottom: 1.2em; }
#pricing-content {
display: initial;
padding: 0.05px;
margin: 1em auto;
}
.card {
width: 300px;
margin: 1em auto 0.5em;
}
}
#media(max-width: 550px) {
#video {
width: 90vw;
height: 50.625vw;
}
}
#features,
#demo,
#pricing,
#contact{ margin-top:-100px; padding-top:100px;}
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css'><link rel="stylesheet" href="./style.css">
<header id="header">
<div id="logoNtitle">
<img src="https://www.freepnglogos.com/uploads/eagles-png-logo/eagle-sports-png-logos--0.png" alt="product logo" id="header-img" class="inline">
<span id="header-text">The Lorem Ipsum</span>
</div>
<nav id="nav-bar">
<div id="links">
<span>Features</span>
<span>Demo</span>
<span>Pricing</span>
<span>Contact Us!</span>
</div>
</nav>
</header>
<div id="main">
<p class="text-center ubuntu pclass"> Provide your email for more information about product </p>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<label for="email">
<input type="email" id="email" name="email" placeholder="Enter your email address">
</label>
<input type="submit" value="Submit" id="submit">
</form>
<div id="features" class="ubuntu">
<div id="features-1">
<div class="flex">
<div class="ico"><i class="fas fa-air-freshener fa-2x"></i></div>
<div class="content">
<h3>Premium quality material</h3>
<span>Lorem ipsum dolor sit amat, consecite adispicing elit, ipsum dolor sit amat, consecite adispicing elit</span>
</div>
</div>
<div class="flex">
<div class="ico"><i class="fas fa-shipping-fast fa-2x"></i></div>
<div class="content">
<h3>Fast shipping</h3>
<span>Lorem ipsum amat, dolorem ipsum</span>
</div>
</div>
<div class="flex">
<div class="ico"><i class="fas fa-user-clock fa-2x"></i></div>
<div class="content">
<h3>Timely maintenance updates</h3>
<span>Lorem ipsum dolor sit amat, consecite adispicing elit</span>
</div>
</div>
</div>
<div id="features-2">
<p class="bold feature-title">Why to choose us ?</p>
<ul> <!-- use css list-style-type: none; to remove bullets
use list-style-image: url(img.png) to use an image as bullet -->
<li>Lorem ipsum dolor</li>
<li>sit amet, consectetur adipiscing elit</li>
<li>Nunc tempor</li>
<li>dolorem ipsum quia</li>
<li>Lorem ipsum dolor</li>
<li>sit amet, consectetur adipiscing elit</li>
<li>Nunc tempor</li>
<li>dolorem ipsum quia</li>
</ul>
</div>
</div>
<div id="demo">
<h2 id="video-title">Here is how it works !!!</h2>
<div class="video-container">
<iframe width="729" height="410" id="video" src="https://www.youtube.com/embed/CmzKQ3PSrow" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div id="pricing">
<div id="pricing-content">
<div class="card">
<h3>Basic Package</h3>
<h2>$500</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="false">Dolor sit, amat</li>
<li class="false">Nunc tempor</li>
<li class="false">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
<div class="card">
<h3>Premium Package</h3>
<h2>$600</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="true">Dolor sit, amat</li>
<li class="false">Nunc tempor</li>
<li class="false">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
<div class="card">
<h3>Pro Package</h3>
<h2>$800</h2>
<ul class="no-bullets">
<li class="true">Lorem ipsum</li>
<li class="true">Dolor sit, amat</li>
<li class="true">Nunc tempor</li>
<li class="true">dolorem ipsum quia</li>
</ul>
<button type="button">Select</button>
</div>
</div>
</div>
<footer id="contact">
<div class="footer-content">
<ul class="no-bullets">
<li>Privacy</li>
<li>Terms</li>
<li>Contact</li>
</ul>
<p>&copyThe Lorem Ipsum</p>
</div>
</footer>
</div>

How do I make stop my nav from overflowing onto my div

I am learning front end web development and I am stuck with how to make my website responsive. I am currently trying to stop my navigation from overlapping onto the next div container. How do I do this please and if you have any other tips on how to make my website responsive that would be great thanks.
Am I using the media queries correctly? I'm now aware I should be using a mobile first approach, but at first I was just copying a mockup I saw online so I had to do it the other way around.
My code is on codepen, here: https://codepen.io/wmufunde/pen/vYYWOBy
<html>
<head>
<title>Best Bakery Company</title>
<link href="https://fonts.googleapis.com/css?family=Jomolhari|Tangerine|Work+Sans&display=swap" rel="stylesheet">
</head>
<header>
<nav>
<ul>
<li id="logo-top">Best Bakery Company</li>
<li class= "nav">WELCOME</li>
<li class= "nav">MENU</li>
<li class= "nav">RESERVATIONS</li>
<li class= "nav">NEWS</li>
<li class= "nav">CONTACT</li>
<li class= "nav"><i class="fab fa-twitter"></i></li>
<li class= "nav"><i class="fab fa-facebook-f"></i></li>
<li><i class="fab fa-instagram"></i></li>
</ul>
</nav>
<div id="headings">
<h1>Pastry with love</h1>
<h2>We're bringing you fresh ingredients<br> everyday in ways you can't resist.</h2>
<button class="btn">Menu</button>
</div>
</header>
<body>
<div class="row" id="background1">
<div class="column">
<h1>Art of cakes</h1>
<h2>We create delicious memories</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Adipiscing elit pellentesque habitant morbi. Mauris augue neque gravida in fermentum et sollicitudin ac.</p>
<h3>Chef cook</h3>
<div = id="chef"><img src="img/chef.jpg" align="middle"></div>
<p id="cursive">Unique creatives for unique reasons</p>
</div>
<div class="column" id="relative">
<div class ="row-pastry" id="padding">
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/pastry1.jpg">
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/pastry2.jpg">
</div>
<div class="row-pastry">
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/pastry3.jpg">
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/pastry4.jpg">
</div>
<div id="icon"><p>TASTES SO <br>GOOD!</p></div>
</div>
</div>
<div class="row" id="background2">
<div class="column center"id="white">
<h1>Tasty Pancakes</h1>
<h2>Season Favourites</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Adipiscing elit pellentesque habitant morbi. Mauris augue neque gravida in fermentum et sollicitudin ac.</p>
<div class="image-circle">
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/blueberry.jpg">
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/pancake.jpg">
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/pancake2.jpg">
</div>
</div>
</div>
<div class="row" id="background3">
<div class="column breakfast">
<h1>Breakfast</h1>
<p>7AM Breakfast? We're Open!</p>
<h2>Full Breakfast</h2>
<p>Lorem ipsum dolor sit amet</p>
<h3>£12.50</h3>
<h2>Toast and Jam</h2>
<p>Lorem ipsum dolor sit amet</p>
<h3>3.50</h3>
<h2>Muffins</h2>
<p>Lorem ipsum dolor sit amet</p>
<h3>£4.99</h3>
</div>
</div>
<div class="row" id="background4">
<div class="column meal">
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/page4/wheat.jpg">
<h1>Wheat</h1>
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/page4/eggs.jpg">
<h1>Eggs</h1>
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/page4/cheese.jpg">
<h1>Cheese</h1>
</div>
<div class="column sandwich">
<h1>The Jibarito Sandwich</h1>
<h2>The Best Sandwich you've Ever Tasted!</h2>
<img src="http://wadzanai.co.uk/100daysofcode/Day7/img/page4/sandwich.jpg">
</div>
</div>
<script src="https://kit.fontawesome.com/5b02610863.js" crossorigin="anonymous"></script>
</body>
<footer>
<ul>
<li>Our Menu</li>
<li>Gallery</li>
<li>Culture</li>
<li id="logo-footer">Best Bakery Company</li>
<li>Events</li>
<li>Catering</li>
<li>Visit Us</li>
</ul>
</footer>
/* ==========================================
Page 1 & Navigation
============================================ */
header {
background-image: url("http://wadzanai.co.uk/100daysofcode/Day7/img/header.jpg");
background-repeat: no-repeat;
background-size: cover;
height: 100%;
width: 100%;
}
nav {
position: fixed;
top: -20px;
z-index: 1500;
width: 100%;
/* display: block; */
}
nav ul {
display: flex;
flex-direction: row;
justify-content: space-around;
flex-wrap: wrap;
background: rgba(0,0,0, 0.5);
height: 50px;
}
a {
text-decoration: none;
color:white;
}
nav ul li {
list-style: none;
color: white;
padding-top: 1%;
font-family: 'Work Sans', sans-serif;
}
#logo-top {
font-family: 'Tangerine', cursive;
font-size: 45px;
padding-top: 0;
flex-grow: 5;
}
nav ul li {
flex-grow: 1;
}
header h1 {
font-family: 'Jomolhari', serif;
color: white;
font-size: 50px;
letter-spacing: 5px;
}
header h2 {
font-family: 'Work Sans', sans-serif;
font-size: 20px;
color: white;
letter-spacing: 5px;
}
#headings {
display: flex;
min-height: 80vh;
width: 100%;
flex-direction: column;
}
#headings h1,h2, .btn {
margin: auto;
}
.btn {
padding: 20px 80px;
background: rgba(0,0,0, 0.5);
border-radius: 50px;
border-color: black;
color:white;
}
.row {
display: flex;
justify-content: flex-start;
position: relative;
height: 100vh;
}
/* ==========================================
Page2
============================================ */
#background1 {
background-color: beige;
}
.column{
width:50vw;
}
.column h1, h2 {
font-family: 'Jomolhari', serif;
}
.column h1, h2, h3, p, #chef img {
text-align: center;
}
.column h1 {
font-size: 50px;
color: #330000;
}
.column h2 {
font-size: 25px;
color: saddlebrown;
}
.column p {
font-family: 'Work Sans', sans-serif;
}
#cursive{
font-family: 'Tangerine', cursive;
font-size:50px;
}
#chef img{
border-radius: 50%;
width: 15vw;
height: 20vh;
display: block;
margin-left: auto;
margin-right: auto;
}
.row-pastry img {
height: 25vh;
width: 150%;
}
.row-pastry {
width: 25%;
display: flex;
padding-left: 5vw;
}
#padding {
padding-top: 15vh;
}
#icon{
width: 50%;
position: absolute;
top: 27%;
right: 26.5%;
background-color: white;
height: 200px;
display: flex;
clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
#icon p{
padding-top: 20%;
padding-left: 35%;
}
#relative {
position: relative;
}
/* ==========================================
Page 3
============================================ */
#background2 {
background-image: url(http://wadzanai.co.uk/100daysofcode/Day7/img/background2.jpg);
background-repeat: no-repeat;
background-size: cover;
}
.center {
margin: auto;
}
#white {
background: white;
height:60%;
width:50vw;
margin: auto;
padding: 2%;
}
.image-circle {
display: flex;
flex-direction: row;
justify-content: space-around;
min-height: 50vh;
}
.image-circle img {
height: 10vh;
width: 5vw;
border-radius: 50%;
}
/* ==========================================
Page 4 - Breakfast Menu
============================================ */
#background3 {
background-image: url(http://wadzanai.co.uk/100daysofcode/Day7/img/background3.jpg);
background-repeat: no-repeat;
background-size: cover;
display: flex;
min-width: 50vw;
}
.breakfast {
background:rgba(255, 255, 255, 0.75);
margin:auto;
width: 25vw;
height: 100vh;
}
/* ==========================================
Page 5 - Sandwich
============================================ */
#background4 {
background: beige;
padding: 2%;
}
.meal {
display: flex;
flex-direction: column;
justify-content: space-between;
min-width: 50vw;
}
.meal img {
width: 10vw;
border-radius: 50%;
margin: auto;
}
.meal h1 {
font-size: 25px;
text-align: left;
margin: auto;
}
.sandwich img {
width: 33vw;
}
/* ==========================================
Footer
============================================ */
footer {
background-color: saddlebrown;
}
footer ul li {
list-style: none;
color:black;
font-size: 25px;
font-family: 'Work Sans', sans-serif;
flex-grow: 1;
}
footer ul {
display: flex;
justify-content: space-between;
align-items: center;
}
#logo-footer {
font-family: 'Tangerine', cursive;
font-size: 45px;
flex-grow: 2;
}
/* ==========================================
Transitions and Transforms
============================================ */
li a:hover {
color: yellow;
}
.btn {
transition-duration: 2s;
transition-property: scale;
}
.fab {
transition-duration: 0.5s;
transition-property: scale;
}
.fab:hover, .btn:hover {
transform: scale(1.2);
}
/* Page 2 */
.image-circle img {
transition-duration: 1s;
transition-property: transform;
}
.image-circle img:hover {
transform: rotate(30deg);
}
/* ==========================================
Page 1 & Navigation Media Queries
============================================ */
#media screen and (max-width: 850px) {
nav ul {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
height: 250px;
text-align: center;
}
footer ul {
flex-direction: column;
flex-wrap: nowrap
}
.breakfast {
width: 50vw;
}
.center h1 {
font-size: 30px;
}
.center h2 {
font-size: 20px;
}
.center p {
font-size: 15px;
}
}
#media screen and (max-width: 625px) {
.sandwich h1 {
font-size: 30px;
}
.sandwich h2 {
font-size: 20px;
}
}
#media screen and (max-width: 600px) {
.row-pastry {
flex-direction: column;
}
.row-pastry img {
height: auto;
}
#icon {
display: none;
}
}

Scroll issue in chat webdesign

I am getting scroll issue in chat website. Where bottom scrollbar is not visible and scroll is not working in live chat.
#charset "utf-8";
/* CSS Document */
html,
body {
font-family: Arial, Gotham, "Helvetica Neue", Helvetica, sans-serif;
line-height: 20px;
margin: 0;
padding: 0;
overflow: hidden;
box-sizing: border-box;
height: 100%;
}
.inner {
max-width: 100%;
padding: 0 20px;
}
.col-1,
.col-10,
.col-11,
.col-12,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9 {
display: block;
position: relative;
float: left;
width: 100%
}
.text-left {
text-align: left;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
header {
position: fixed;
z-index: 9999;
top: 0;
left: 0;
width: 100%;
background: #333;
min-height: 60px;
}
header:after {
clear: both;
content: '';
display: table;
}
header nav {
position: relative;
padding: 20px;
}
.credit {
position: absolute;
top: 0;
right: 40px;
color: #fff;
text-align: right;
text-transform: capitalize;
font-weight: 700;
}
.credit i {
position: absolute;
top: 26px;
padding-left: 20px;
}
.credit p {
margin: 10px 0 0 0;
padding: 0;
}
.trigger {
display: inline-block;
cursor: pointer;
}
.bar1,
.bar2,
.bar3 {
width: 28px;
height: 3px;
background-color: #fff;
margin: 6px 0;
transition: 0.4s;
}
/* Rotate first bar */
.change .bar1 {
-webkit-transform: rotate(-45deg) translate(-4px, 6px);
transform: rotate(-45deg) translate(-9px, 6px);
}
/* Fade out the second bar */
.change .bar2 {
opacity: 0;
}
/* Rotate last bar */
.change .bar3 {
-webkit-transform: rotate(45deg) translate(-8px, -8px);
transform: rotate(45deg) translate(-8px, -8px);
}
.col-3:after {
content: '';
clear: both;
display: block;
}
.logo a {
position: absolute;
top: 26px;
left: 80px;
font-size: 28px;
display: block;
text-decoration: none;
color: #fff;
text-transform: uppercase;
}
.bets,
.video,
.chat {
position: relative;
overflow-y: scroll;
height: 100%;
z-index: 1;
background: #191919;
}
.PB15 {
padding: 15px 15px 15px 30px;
}
.section {
position: relative;
height: 100%;
width: 100%;
padding-top: 78px;
}
.PB80 {
padding-bottom: 78px;
}
.bets-title {
background: #282828;
padding: 15px 15px 15px 45px;
color: #fff;
line-height: 15px;
}
.bets-title span {
padding-left: 15px;
font-weight: 600;
}
.video {
background: #222222;
}
.video .video-content {
padding: 20px 10px 30px 60px;
}
.wrapper {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
overflow: scroll;
}
.video-title {
list-style: none;
color: #fff;
margin: 0;
padding: 0;
}
.video-title li {
display: inline-block;
}
.video-title li:first-child {
font-size: 20px;
font-weight: 700;
}
.video-title li:last-child {
color: rgba(159, 159, 159, 1.00);
position: absolute;
right: 0;
margin-right: 20px;
}
.list {
list-style: none;
margin: 0;
padding: 10px 0 0 0;
}
.video h3 {
color: #fff;
}
.list li {
display: inline-block;
color: #fff;
}
.list span {
padding: 0 20px 0 10px;
color: rgba(159, 159, 159, 1.00);
}
.max-100 {
display: block;
max-width: 100%;
}
.chat .bets-title {
margin-bottom: 10px;
}
.container {
padding: 20px 0 0 20px;
}
.users {
position: relative;
margin-bottom: 15px;
display: flex;
}
.users img {
width: 30px;
height: 30px;
max-width: 100%;
}
.username {
color: #a7a7a7;
font-weight: 600;
}
.users .user-msg {
color: #fff;
padding: 0 20px;
}
.users span:last-child {
padding-left: 10px;
}
.col-1 {
width: 8.33333333333%
}
.col-2 {
width: 16.6666666667%
}
.col-3 {
width: 25%
}
.col-4 {
width: 33.3333333333%
}
.col-5 {
width: 41.6666666667%
}
.col-6 {
width: 50%
}
.col-7 {
width: 58.3333333333%
}
.col-8 {
width: 66.6666666667%
}
.col-9 {
width: 75%
}
.col-10 {
width: 83.3333333333%
}
.col-11 {
width: 91.6666666667%
}
.col-12 {
width: 100%
}
#media (min-width: 768px) {
.col-3 {
width: 100%;
}
.col-6 {
width: 100%;
}
}
#media (min-width: 1200px) {
.col-1 {
width: 8.33333333333%
}
.col-2 {
width: 16.6666666667%
}
.col-3 {
width: 25%
}
.col-4 {
width: 33.3333333333%
}
.col-5 {
width: 41.6666666667%
}
.col-6 {
width: 50%
}
.col-7 {
width: 58.3333333333%
}
.col-8 {
width: 66.6666666667%
}
.col-9 {
width: 75%
}
.col-10 {
width: 83.3333333333%
}
.col-11 {
width: 91.6666666667%
}
.col-12 {
width: 100%
}
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Live Chat</title>
</head>
<body>
<header>
<div class="inner">
<nav>
<div class="trigger" onclick="myFunction(this)">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</div>
<div class="logo">Chat
</div>
<div class="credit">
<p>Credtis available</p>
<p>23,000</p>
<i class="fa fa-user-circle"></i>
</div>
</nav>
</div>
</header>
<div class="section">
<div class="col-3">
<div class="bets-title">
<i class="fa fa-angle-right"></i> <span>Live Bets</span>
</div>
<div class="bets">
</div>
<div class="PB80"></div>
</div>
<div class="col-6 video">
<div class="video-contents">
<video width="100%" height="100%" controls>
<source src="demo.mp4" type="video/mp4"></source>
Your browser does not support the video tag.
</video>
<div class="video-content">
<ul class="video-title">
<li>The Mighty Scrpio VS Legacy Prime Mantis</li>
<li>1,548 watching now</li>
</ul>
<ul class="list">
<li><i class="fa fa-thumbs-o-up"></i><span>2.8k</span>
</li>
<li><i class="fa fa-thumbs-o-down"><span>112</span></i>
</li>
<li><i class="fa fa-reply"></i>
</li>
</ul>
<h3>Current Best Total: 13,000 credits</h3>
</div>
</div>
<div class="video-contents">
<video width="100%" height="100%" controls>
<source src="demo.mp4" type="video/mp4"></source>
Your browser does not support the video tag.
</video>
<div class="video-content">
<ul class="video-title">
<li>The Mighty Scrpio VS Legacy Prime Mantis</li>
<li>1,548 watching now</li>
</ul>
<ul class="list">
<li><i class="fa fa-thumbs-o-up"></i><span>2.8k</span>
</li>
<li><i class="fa fa-thumbs-o-down"><span>112</span></i>
</li>
<li><i class="fa fa-reply"></i>
</li>
</ul>
<h3>Current Best Total: 13,000 credits</h3>
</div>
</div>
<div class="video-contents">
<video width="100%" height="100%" controls>
<source src="demo.mp4" type="video/mp4"></source>
Your browser does not support the video tag.
</video>
<div class="video-content">
<ul class="video-title">
<li>The Mighty Scrpio VS Legacy Prime Mantis</li>
<li>1,548 watching now</li>
</ul>
<ul class="list">
<li><i class="fa fa-thumbs-o-up"></i><span>2.8k</span>
</li>
<li><i class="fa fa-thumbs-o-down"><span>112</span></i>
</li>
<li><i class="fa fa-reply"></i>
</li>
</ul>
<h3>Current Best Total: 13,000 credits</h3>
</div>
</div>
<div class="PB80"></div>
</div>
<div class="col-3">
<div class="bets-title">
<i class="fa fa-angle-right"></i> <span>Live Chat</span>
</div>
<div class="chat PB15">
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Rupareliya</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Raina</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet</span><span>Lorem ipsum</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Rupareliya</span><span>Lorem ipsum dolor sit amet, consectetur adipisicing.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Raina</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Rupareliya</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Raina</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet</span><span>Lorem ipsum</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Rupareliya</span><span>Lorem ipsum dolor sit amet, consectetur adipisicing.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Raina</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Rupareliya</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Raina</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet</span><span>Lorem ipsum</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Rupareliya</span><span>Lorem ipsum dolor sit amet, consectetur adipisicing.</span>
</div>
</div>
<div class="users">
<div class="user-msg">
<span class="username">Abhijeet Raina</span><span>Lorem ipsum dolor sit amet, consectetur.</span>
</div>
</div>
<div class="PB80"></div>
</div>
</div>
</div>
</body>
</html>
Your chat class is assigned to wrong block. You have col-6 video block. Under that you have block with class col-3 to wrap your chat html. Just give him your special class chat and everything should work