Problem displaying <ul> element inside div - html

I'm creating footer for my website. I encounter problems that seem to be banal, maybe not. Inside the 'footer' element is a list of 'ul', inside them 'li' with links to social media. The Chrome browser does not display these elements, similarly to Opera and Mozilla. Where is the problem? I am running out of ideas.
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
body {
font-family: 'Lato', 'Josefin Sans', sans-serif;
font-size: 0;
}
.navbar {
font-size: 18px;
width: 100%;
position: fixed;
background-color: rgba(0, 0, 0, 0.8);
border: 1px solid rgba(0, 0, 0, 0.2);
padding-bottom: 10px;
}
.main-nav {
list-style-type: none;
}
.nav-links,
.logo {
text-decoration: none;
color: rgba(255, 255, 255, 0.7);
vertical-align: middle;
}
.main-nav li {
text-align: center;
margin: 15px auto;
}
.logo {
display: inline-block;
font-size: 22px;
margin-top: 10px;
margin-left: 20px;
}
.navbar-toggle {
position: absolute;
top: 10px;
right: 20px;
cursor: pointer;
color: rgba(255, 255, 255, 0.8);
font-size: 24px;
}
.main-nav {
list-style-type: none;
display: none;
}
.active {
display: block;
}
.background-image img {
height: 100%;
width: 100%;
}
.container {
display: flex;
height: 250px;
}
.column-left {
width: 33.333%;
background: #f2f2f2;
border: 1px solid #e6e6e6;
}
.column-center {
width: 33.333%;
background: #f2f2f2;
border: 1px solid #e6e6e6;
}
.column-right {
width: 33.333%;
background: #f2f2f2;
border: 1px solid #e6e6e6;
}
.container .column-left {
text-align: center;
padding-top: 20px;
font-size: 20px;
}
h2 {
font-size: 23px;
padding: 15px;
}
p {
font-size: 20px;
padding: 15px;
}
.container .column-center {
text-align: center;
padding-top: 20px;
font-size: 20px;
}
.container .column-right {
text-align: center;
padding-top: 20px;
font-size: 20px;
}
#media screen and (min-width: 600px) {
.navbar {
display: flex;
justify-content: space-between;
padding-bottom: 0;
height: 70px;
align-items: center;
}
.main-nav {
display: flex;
margin-right: 30px;
flex-direction: row;
justify-content: flex-end;
}
.main-nav li {
margin: 0;
}
.nav-links {
margin-left: 40px;
}
.logo {
margin-top: 0;
}
.navbar-toggle {
display: none;
}
.logo:hover,
.nav-links:hover {
color: rgba(255, 255, 255, 1);
}
}
#media screen and (max-width: 599px) {
h2.title {
font-size: 15px;
}
p {
font-size: 13px;
}
}
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<script src="https://kit.fontawesome.com/8a84b6b9df.js"></script>
<div>
<nav class="navbar">
<span class="navbar-toggle" id="js-navbar-toggle">
<i class="fas fa-bars"></i>
</span>
<img src="img/developer.png" alt="Sebastian Falba" width="50">
<ul class="main-nav" id="js-menu">
<li>
Home
</li>
<li>
About me
</li>
<li>
Projects
</li>
<li>
Contact
</li>
</ul>
</nav>
</div>
<div class="background-image">
<img src="img/responsive.jpg" alt="web development">
</div>
<div class="container">
<div class="column-left"><i class="fas fa-keyboard fa-3x"></i>
<h2 class="title">Modern design</h2>
<p class="description">Fantastic Clean Website Designs</p>
</div>
<div class="column-center"><i class="far fa-window-maximize fa-3x"></i>
<h2 class="title">Responsive</h2>
<p class="description">Make your website mobile-friendly</p>
</div>
<div class="column-right"><i class="fas fa-laptop-code fa-3x"></i>
<h2 class="title">Quality code</h2>
<p class="description">Coding best practices are a set of my rules</p>
</div>
</div>
<footer>
<ul>
<li>Footer</li>
</ul>
</footer>

You set the font-size to 0 so the text has no height.
Since the text has no height, the <a> has no height, so the <li> has no height, so the <ul> has no height, to the <footer> has no height, so you can't see it.

Related

divs appear above the footer instead of inside the footer

I am just practicing CSS/HTML and am trying to make a google clone. Everything else seems fine but now I am trying to make a footer and whenever I put a div inside the footer, they appear on top of the footer instead of inside the footer.
#import url('https://fonts.googleapis.com/css2?family=Roboto:wght#300;400;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Roboto', sans-serif;
background-color: rgb(32, 33, 36);
color: white;
}
a {
text-decoration: none;
color: inherit;
}
.nav-bar a:nth-child(1):hover {
text-decoration: underline;
}
.nav-bar a:nth-child(2):hover {
text-decoration: underline;
}
.nav-bar {
height: 50px;
display: flex;
align-items: center;
justify-content: flex-end;
}
.nav-items {
list-style: none;
display: flex;
justify-content: flex-end;
align-items: center;
}
.nav-items li {
margin-left: 15px;
}
.menu-icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
width: 40px;
height: 40px;
padding: 10px;
border-radius: 50%;
}
.menu-icon:hover {
background-color: rgba(138, 133, 133, 0.26);
}
.menu-icon span {
background-color: #ffffff;
width: 20px;
height: 2px;
}
.profile-picture {
margin-right: 15px;
height: 32px;
width: 32px;
border-radius: 50%;
}
.profile-picture:hover {
box-shadow: 0px 0px 0px 5px #7068683b;
}
.profile-picture img {
border-radius: 50%;
width: 100%;
}
.main-section {
display: flex;
justify-content: center;
align-items: center;
margin-top: 80px;
}
.google-logo {
width: 375px;
height: 150px;
}
.google-logo img {
width: 100%;
}
.search-section {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.search-container {
display: flex;
justify-content: center;
align-items: center;
width: 580px;
border: solid;
border-color: #949090;
border-width: 1px;
border-radius: 300px;
padding: 9px;
height: 45px;
}
.search-container:hover {
box-shadow: 0px 0px 10px 2px #00000036;
}
.search-icon {
width: 25px;
height: 25px;
margin-right: 5px;
}
.search-icon img {
width: 100%;
}
.search-bar {
width: 550px;
height: 30px;
border: none;
outline: none;
}
.microphone {
width: 25px;
height: 25px;
}
.microphone img {
width: 100%;
}
.search-buttons {
margin-top: 25px;
}
.search-buttons button {
margin-left: 6px;
padding: 10px 16px 10px 16px;
background-color: #303134;
border: none;
border-radius: 4px;
color: #e8eaed;
font-size: 14px;
cursor: pointer;
border: solid 1px transparent;
}
.search-buttons button:hover {
border-color: #e8eaed;
}
.language-selector {
display: flex;
justify-content: center;
margin-top: 30px;
}
.language-selector p {
font-size: 13px;
color: #bdc1c6;
}
.language-selector a {
color: #8ab4f8;
}
.footer {
background-color: #446adb;
height: 100px;
margin-top: 92px;
}
<body>
<!-- start of the navigation bar-->
<nav class="nav-bar">
<ul class="nav-items">
<li>Gmail</li>
<li>სურათები</li>
<li>
<a href="#">
<div class="menu-icon">
<span>
</span>
<span>
</span>
<span>
</span>
</div>
</a>
</li>
<li>
<a href="#"><div class="profile-picture">
<img src="icons/unnamed.png">
</div></a>
</li>
</ul>
</nav>
<!-- end of the navigation bar -->
<!-- start of the main section (logo and search-bar)-->
<div class="main-section">
<a href="#"><div class="google-logo">
<img src="icons/google.png">
</div></a>
</div>
<div class="search-section">
<div class="search-container">
<div class="search-icon"><img src="icons/search.png"/></div>
<input type="text" class="search-bar">
<div class="microphone"><img src="icons/micro.png" alt=""></div>
</div>
<div class="search-buttons">
<button>
Google ძებნა
</button>
<button>
იღბალს მივენდობი
</button>
</div>
</div>
<div class="language-selector">
<p>Google ხელმისაწვდომია შემდეგ ენაზე: English</p>
</div>
<!-- end of the main section -->
<!-- start of the footer-->
<footer class="footer">
<div class="current-location">
this text should be inside the footer
</div>
</footer>
</body>
here is the picture of the problem I am having.
https://i.stack.imgur.com/AXMv6.png
It is inside the footer. Just this property:
background-color: rgb(32, 33, 36);
which you set for * gets inherited, and the bg color makes you think text it outside the footer. Comment it out for a while and you will see.

Footer covers content

I am trying to build my personal webpage but simply cant manage to make my footer not cover the two buttons.
This problem only occurs on my laptop. As soon as I switch to my external monitor, the two buttons arent covered anymore.
I have tried inserting html{overflow-y: scroll;} to my css but it doesnt seem to work :(
Any help would be awesome! Thank you.
HTML:
#import url('https://fonts.googleapis.com/css?family=Roboto:700&display=swap');
* {
padding: 0;
margin: 0;
}
body {
background-color: ghostwhite;
background-size: cover;
padding: 0;
margin: 0;
}
.navbar {
height: 80px;
width: 100%;
background-color: #808080;
}
.logo {
width: 140px;
height: auto;
padding: 15px 50px;
}
.navbar ul {
float: right;
margin-right: 20px;
}
.navbar ul li {
list-style: none;
margin: 0 8px;
display: inline-block;
line-height: 80px;
}
.navbar ul li a {
text-decoration: none;
color: white;
font-size: 20px;
padding: 2px 6px;
font-family: 'Roboto', sans-serif;
transition: .2s;
}
.navbar ul li a:hover {
background: lightsteelblue;
border-radius: 2px;
}
.wrapper .center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: sans-serif;
user-select: none;
}
.center h1 {
color: black;
font-size: 70px;
font-weight: bold;
width: 900px;
text-align: center;
}
.center h2 {
color: black;
font-size: 70px;
font-weight: bold;
width: 885px;
margin-top: 10px;
text-align: center;
}
.center .buttons {
margin: 35px 280px;
}
.buttons button {
height: 50px;
width: 150px;
font-size: 18px;
font-weight: bold;
color: white;
background-color: lightsteelblue;
border: 1px solid #4b79b4;
outline: none;
cursor: pointer;
border-radius: 25px;
transition: .5s;
}
.buttons .btn {
margin-left: 25px;
}
.buttons button:hover {
background: #4b79b4;
}
footer {
position: absolute;
background-color: #808080;
height: auto;
width: 100%;
padding-top: 40px;
color: black;
bottom: 0px;
}
.footer-content {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
text-align: center;
}
.footer-content h3 {
font-size: 1.8rem;
font-weight: 400;
text-transform: capitalize;
line-height: 3rem;
}
.footer-content p {
max-width: 500px;
margin: 10px auto;
line-height: 28px;
font-size: 14px;
}
.socials {
list-style: none;
display: flex;
align-items: center;
justify-content: center;
margin: 1rem 0 3rem 0;
}
.socials li {
margin: 0 10px;
}
.socials a {
text-decoration: none;
color: lightsteelblue;
}
.socials a i {
font-size: 1.1rem;
transition: color .4s ease;
}
.socials a:hover i {
color: #4b79b4;
}
.footer-bottom {
background-color: #737373;
width: 100%;
padding: 20px 0;
text-align: center;
}
.footer-bottom p {
font-size: 14px;
word-spacing: 2px;
text-transform: capitalize;
}
.footer-bottom span {
text-transform: uppercase;
opacity: .4;
font-weight: 200;
}
<!doctype html>
<html lang="en ">
<head>
<meta charset="utf-8">
<title>Moritz </title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="wrapper">
<!-- BEGIN NAVBAR -->
<nav class="navbar">
<img class="logo" src="logo.png">
<ul>
<li> <a class="active" href="#">Home</a></li>
<li> About</li>
<li> CV</li>
<li> Favourites</li>
<li> Contact</li>
</ul>
</nav>
<!-- END NAVBAR -->
<!-- BEGIN CONTENT -->
<div class="center">
<h1>Hi, I'm Moritz.</h1>
<h2>I'm a student.</h2>
<div class="buttons">
<button>Explore more</button>
<button class="btn">Contact me</button>
</div>
<!-- END CONTENT -->
</div>
<!-- BEGIN FOOTER -->
<footer>
<div class="footer-content">
<h3>Moritz </h3>
<p>Thank you for browsing. I hope to hear from you soon!</p>
<ul class="socials">
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-linkedin-square"></i></li>
<li><i class="fa fa-envelope"></i></li>
<li><i class="fa fa-phone"></i></li>
</ul>
</div>
<div class="footer-bottom">
<p> Copyright © 2021 Moritz </p>
</div>
</footer>
<!-- END FOOTER -->
</body>
</html>
What you describe kind of feels like a grid to me using three "rows", one for the "navbar", one for the "content" and one for the "footer" such as:
display: grid;
grid-template-rows: auto 1fr auto;
Now given that we can put the containers for the rows in a wrapper .wrapper
Then we tall it which "row" each of the sections belongs in. grid-row: 2/2; for the content for example in row 2 (start and end)
I took a good bit of liberty with your CSS (it is still a "lot" just for this) specifically, I added borders to show where things are - you will want to remove those but I did it to illustrate where is "is" in the flow.
This is by no means "perfect" but just a very quick place to build from.
#import url('https://fonts.googleapis.com/css?family=Roboto:700&display=swap');
* {
padding: 0;
margin: 0;
}
body {
background-color: ghostwhite;
padding: 0;
margin: 0;
border: solid orange 3px;
}
.wrapper {
display: grid;
grid-template-rows: auto 1fr auto;
border: lime 4px dashed;
}
.navbar-container {
border: red 4px solid;
grid-row: 1/1;
display: flex;
align-items: start;
margin: 0rem;
}
.content-container {
font-family: sans-serif;
display: grid;
place-items: center;
grid-row: 2/2;
border: blue 1px solid;
}
.footer-container {
padding-top: 2rem;
display: grid;
grid-template-rows: auto 1fr auto;
border: cyan 1px solid;
}
.footer-content {
display: grid;
grid-template-rows: 1fr auto 1fr;
align-items: center;
justify-items: center;
}
.footer-bottom {
grid-row: 3/3;
align-text: center;
padding: 0.25rem;
border: dashed blue 1px;
}
.navbar {
height: 5rem;
width: 100%;
background-color: #808080;
font-family: 'Roboto', sans-serif;
}
.navbar>.logo {
width: 140px;
height: auto;
padding-bottom: 15px;
padding-top: 15px;
padding-left: 50px;
padding-right: 50px;
border: solid 1px green;
}
.navbar ul li {
list-style: none;
margin: 0 8px;
display: inline-block;
line-height: 80px;
}
.navbar ul li a {
text-decoration: none;
color: white;
font-size: 20px;
padding: 2px 6px;
transition: 0.2s;
}
.navbar ul li a:hover {
background: lightsteelblue;
border-radius: 2px;
}
.wrapper .center {
user-select: none;
}
.buttons {
display: flex;
flex-direction: row;
margin-top: 1rem;
margin-bottom: 1rem;
}
.buttons button {
margin: 1rem;
}
.buttons button {
flex: auto;
height: 50px;
width: 150px;
font-size: 18px;
font-weight: bold;
color: white;
background-color: lightsteelblue;
border: 1px solid #4b79b4;
outline: none;
cursor: pointer;
border-radius: 25px;
transition: .5s;
}
.buttons button:hover {
background: #4b79b4;
}
.socials {
list-style: none;
display: flex;
align-items: middle;
justify-content: center;
}
.socials li {
margin-right: 10px;
}
.footer-bottom {
font-size: 0.75rem;
background-color: #737373;
text-align: center;
width: 100%;
text-transform: uppercase;
opacity: .4;
font-weight: 200;
}
<!doctype html>
<html lang="en ">
<head>
<meta charset="utf-8">
<title>Moritz </title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="wrapper">
<nav class="navbar navbar-container">
<img class="logo" src="logo.png">
<ul class="menu-items">
<li> <a class="active" href="#">Home</a></li>
<li> About</li>
<li> CV</li>
<li> Favourites</li>
<li> Contact</li>
</ul>
</nav>
<div class="center content-container">
<h1>Hi, I'm Moritz.</h1>
<h2>I'm a student.</h2>
<div class="buttons">
<button>Explore more</button>
<button class="btn">Contact me</button>
</div>
</div>
<footer class="footer-container">
<div class="footer-content">
<h3>Moritz </h3>
<p>Thank you for browsing. I hope to hear from you soon!</p>
<ul class="socials">
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-linkedin-square"></i></li>
<li><i class="fa fa-envelope"></i></li>
<li><i class="fa fa-phone"></i></li>
</ul>
</div>
<div class="footer-bottom">
<p> Copyright © 2021 Moritz </p>
</div>
</footer>
</body>
</html>

Trying to create toggle for icon in NavBar using a checkbox

I am trying to use a checkbox to make my font awesome icon trigger the menu icon to open and close the menu (which is how I want it to be design wise) when the screen is in mobile view.
Thanks in advance for any help.
/*** General ***/
* {
font-family: 'Noto Serif SC', serif;
margin: 0;
padding: 0;
}
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 400px;
height: auto;
}
.contents1 {
margin-top: 5vh;
margin-bottom: 10vh;
}
a {
text-decoration: none;
color: black;
margin: none;
padding: none;
}
/*** Header ***/
.header {
margin-top: 20px;
margin-bottom: 20px;
}
.logo {
text-align: center;
font-size: 30px;
}
/*** Navigation ***/
.fa-bars {
display: none;
}
.nav-links {
width: 100%;
float: left;
position: sticky;
align-items: center;
justify-content: center;
padding: 0;
background-color: #f7f7f7;
border-bottom: 1px solid rgb(228, 224, 224);
display: flex;
}
.nav-links li {
list-style: none;
text-align: center;
font-size: 18px;
float: left;
padding: 14px 16px;
}
.nav-links li a {
text-decoration: none;
text-align: center;
float: left;
}
/*** Footer ***/
.footer {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
text-align: center;
}
.footer2 {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
text-align: center;
}
/*** Media Queries ***/
#media only screen and (max-width: 800px) {
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 375px;
height: auto;
}
}
#media only screen and (max-width: 700px) {
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 350px;
height: auto;
}
}
#media only screen and (max-width: 600px) {
.fa-bars {
font-size: 20px;
display: block;
float: right;
margin-top: 10px;
margin-right: 40px;
cursor: pointer;
}
.logo {
text-align: left;
font-size: 25px;
}
.nav-toggle {
display: none;
}
.nav-links,
ul {
position: fixed;
width: 100%;
height: 100vh;
text-align: center;
background-color: #f7f7f7;
border-bottom: 1px solid rgb(107, 76, 76);
top: 80px;
left: 0;
flex-direction: column;
display: none;
}
.nav-toggle:checked+.nav-links,
ul {
display: flex;
}
.nav-links li {
display: block;
}
.contents1 {
margin-top: 5vh;
}
}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght#200&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<div class="header">
<div>
<div class="logo">
<h4>The Blue Lion <i class="fas fa-bars" id="nav-toggle"></i></h4>
<input type="checkbox" id="nav-toggle" class="nav-toggle">
</div>
</div>
<label for="nav-toggle" class="nav-toggle-label">
<span></span>
</label>
</div>
<div class="navbar">
<div class="nav-links" id="myTopnav">
<ul>
<li a href="#">Food</li>
<li a href="#">Drink</li>
<li a href="#">Covid-19</li>
<li a href="#">News</li>
<li a href="#">Join the Team</li>
</ul>
</div>
</div>
<div class="contents1">
<img src="https://mcdn.wallpapersafari.com/medium/84/3/pQuUz4.jpg" class="bluepic" alt="Blue">
</div>
<div class="footer">
<div class="info">
Leave us a review:
<i class="fab fa-tripadvisor"></i>
</div>
<div class="socialiconsf">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
</div>
</div>
<div class="footer2">
<p>
© The Blue Lion 2021
</p>
</div>
Do this:
* {
font-family: 'Noto Serif SC', serif;
margin: 0;
padding: 0;
}
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 400px;
height: auto;
}
.contents1 {
margin-top: 5vh;
margin-bottom: 10vh;
}
a {
text-decoration: none;
color: black;
margin: none;
padding: none;
}
/*** Header ***/
.header {
margin-top: 20px;
margin-bottom: 20px;
}
.logo {
text-align: center;
font-size: 30px;
}
/*** Navigation ***/
.fa-bars {
display: none;
}
.nav-links {
width: 100%;
float: left;
position: sticky;
align-items: center;
justify-content: center;
padding: 0;
background-color: #f7f7f7;
border-bottom: 1px solid rgb(228, 224, 224);
display: flex;
}
.nav-links li {
list-style: none;
text-align: center;
font-size: 18px;
float: left;
padding: 14px 16px;
}
.nav-links li a {
text-decoration: none;
text-align: center;
float: left;
}
/*** Footer ***/
.footer {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
text-align: center;
}
.footer2 {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
text-align: center;
}
/*** Media Queries ***/
#media only screen and (max-width: 800px) {
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 375px;
height: auto;
}
}
#media only screen and (max-width: 700px) {
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 350px;
height: auto;
}
}
#media only screen and (max-width: 600px) {
.fa-bars {
font-size: 20px;
display: block;
float: right;
margin-top: 10px;
margin-right: 40px;
cursor: pointer;
}
.logo {
text-align: left;
font-size: 25px;
}
.nav-toggle {
display: none;
}
.nav-links,
ul {
width: 100%;
height: 100vh;
text-align: center;
background-color: #f7f7f7;
border-bottom: 1px solid rgb(107, 76, 76);
top: 80px;
left: 0;
flex-direction: column;
display: none;
}
.nav-toggle:checked+.nav-links,
ul {
display: flex;
}
.nav-links li {
display: block;
}
.contents1 {
margin-top: 5vh;
}
}
#media (max-width:600px){
.hamburger-menu{
position: relative;
}
.checkbox:checked~ .nav-links{
display: block;
}
}
<div class="header">
<div>
<div class="logo">
<h4>The Blue Lion
</div>
</h4>
</div>
<label for="nav-toggle" class="nav-toggle-label">
<span></span>
</label>
</div>
</div>
<div class="navbar">
<input type="checkbox" id="check" class="checkbox" hidden>
<label for="check" class="fas fa-bars"></label>
<div class="nav-links" id="myTopnav">
<ul>
<li a href="#">Food</li>
<li a href="#">Drink</li>
<li a href="#">Covid-19</li>
<li a href="#">News</li>
<li a href="#">Join the Team</li>
</ul>
</div>
</div>
<div class="contents1">
<img src="bluepic1.jpg" class="bluepic" alt="Blue">
</div>
<div class="footer">
<div class="info">
Leave us a review:
<i class="fab fa-tripadvisor"></i>
</div>
<div class="socialiconsf">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
</div>
</div>
<div class="footer2">
<p>
© The Blue Lion 2021
</p>
</div>
CSS modification:
The font-awesome library overrides your CSS. That is why your menu-icon (.fa-bars) wouldn't hide when not in mobile mode.
I made following corrections to your CSS:
Changing .fa-bars to .fas.fa-bars
Adding !important in mobile mode
(to show always when media break-point (... and (max-width: 600px))
/*** Navigation ***/
.fas.fa-bars {
display: none;
}
#media only screen and (max-width: 600px) {
.fas.fa-bars {
font-size: 20px;
display: block !important;
float: right;
margin-top: 10px;
margin-right: 40px;
cursor: pointer;
}
}
Click event handler on checkBox:
Also, if you want functionality to your checkbox, then you would have to add an event-handler in JS and add the onClick=function() in your HTML (and correct the issue of the multiple assigned id as mentioned in comments: I replaced id="nav-toggle" with id="nav-toggle-bars" for the <i class="fas fa-bars" element).
Following complete code for you to Run code snippet and comment if this is your desired outcome (please advise).
Expand to "full-page" and change your browser width to see effect
below media break-point (... and (max-width: 600px))
const menuToggle = document.getElementById("nav-toggle-bars");
let menuCheckBox;
function showHideNavToggle(event) {
menuCheckBox = event.target;
if (menuCheckBox.checked) {
menuToggle.style.display = "block";
} else {
menuToggle.style.display = "none";
}
}
/*** General ***/
* {
font-family: 'Noto Serif SC', serif;
margin: 0;
padding: 0;
}
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 400px;
height: auto;
}
.contents1 {
margin-top: 5vh;
margin-bottom: 10vh;
}
a {
text-decoration: none;
color: black;
margin: none;
padding: none;
}
/*** Header ***/
.header {
margin-top: 20px;
margin-bottom: 20px;
}
.logo {
text-align: center;
font-size: 30px;
}
/*** Navigation ***/
.fas.fa-bars {
display: none;
}
.nav-links {
width: 100%;
float: left;
position: sticky;
align-items: center;
justify-content: center;
padding: 0;
background-color: #f7f7f7;
border-bottom: 1px solid rgb(228, 224, 224);
display: flex;
}
.nav-links li {
list-style: none;
text-align: center;
font-size: 18px;
float: left;
padding: 14px 16px;
}
.nav-links li a {
text-decoration: none;
text-align: center;
float: left;
}
/*** Footer ***/
.footer {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
text-align: center;
}
.footer2 {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
text-align: center;
}
/*** Media Queries ***/
#media only screen and (max-width: 800px) {
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 375px;
height: auto;
}
}
#media only screen and (max-width: 700px) {
.bluepic {
padding-top: 10px;
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 350px;
height: auto;
}
}
#media only screen and (max-width: 600px) {
.fas.fa-bars {
font-size: 20px;
display: block !important;
float: right;
margin-top: 10px;
margin-right: 40px;
cursor: pointer;
}
.logo {
text-align: left;
font-size: 25px;
}
.nav-toggle {
display: none;
}
.nav-links,
ul {
position: fixed;
width: 100%;
height: 100vh;
text-align: center;
background-color: #f7f7f7;
border-bottom: 1px solid rgb(107, 76, 76);
top: 80px;
left: 0;
flex-direction: column;
display: none;
}
.nav-toggle:checked+.nav-links,
ul {
display: flex;
}
.nav-links li {
display: block;
}
.contents1 {
margin-top: 5vh;
}
}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght#200&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<div class="header">
<div>
<div class="logo">
<h4>The Blue Lion <i class="fas fa-bars" id="nav-toggle-bars"></i></h4>
<input type="checkbox" onclick="showHideNavToggle(event)" id="nav-toggle" class="nav-toggle">
</div>
</div>
<label for="nav-toggle" class="nav-toggle-label">
<span></span>
</label>
</div>
<div class="navbar">
<div class="nav-links" id="myTopnav">
<ul>
<li a href="#">Food</li>
<li a href="#">Drink</li>
<li a href="#">Covid-19</li>
<li a href="#">News</li>
<li a href="#">Join the Team</li>
</ul>
</div>
</div>
<div class="contents1">
<img src="https://mcdn.wallpapersafari.com/medium/84/3/pQuUz4.jpg" class="bluepic" alt="Blue">
</div>
<div class="footer">
<div class="info">
Leave us a review:
<i class="fab fa-tripadvisor"></i>
</div>
<div class="socialiconsf">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
</div>
</div>
<div class="footer2">
<p>
© The Blue Lion 2021
</p>
</div>
Note:
I also corrected 2 html closing tags (one </div> eliminated and </h4> closing tag corrected and replaced img source with a link to a generic blue background)
See this response in codepen.
https://codepen.io/threefingers/pen/PojZMpx
Add in your ::before element icon, the code icons in your states.
.mydiv{
background-color: blue;
height: 50px;
width: 50px;
}
input + .mydiv::before{
content: 'code icon 1';
}
input:checked + .mydiv::before{
content: 'code icon 2';
}
<input type="checkbox" value="Car"> I have a car
<div class="mydiv"></div>

Where did all the text go on mobile site? Elements not appearing on iPhone.

I have created a website for my dad as a favour for putting me through design school. After uploading it to the network hosting site that my dad uses I discovered that when opening the site on my iPhone, all the text (or most of it) completely disappears. I am not sure what is doing this because when I test the site through Chrome Developer Tools, JsFiddle, etc it appears to be fine. The site is pretty simple so I am using Flexbox for the layout. Let me know if you need any other details.
I am not sure what is going on and would very much appreciate it if someone could take a poke around and point me in the right direction. I am providing a JsFiddle that includes the homepage html and the relevant CSS as well as posting it here. Thanks.
https://jsfiddle.net/ericvnwk/vfnejmw7/2/
The HTML:
<title>
Fairfield Tree Nurseries Inc.</title>
<script src="https://use.typekit.net/hlp7xgg.js"></script>
<script>
try {
Typekit.load({
async: true
});
} catch (e) {}
</script>
<body>
<div class="header">
<img class="logo" src="https://s1.postimg.org/1ic483yqhr/logo.png" alt="Fairfield Tree Nurseries Inc." width="80px" height="80px">
<div class="title"> Fairfield Tree Nurseries Inc.
</div>
<nav class="navbar navtop">
<ul>
<li>About</li>
<li>Products</li>
<li>Shipping</li>
<li>Location</li>
<li>Contact</li>
</ul>
</nav>
</div>
<div class="header-border">
</div>
<div class="main">
<div class="fw-content fw-top">
<div class="fw-image">
<img src="https://s1.postimg.org/1ic4840vnj/welcome.jpg" alt="Welcome to Fairfield Tree Nurseries">
</div>
<div class="cntr-type">
<h2> Welcome to </h2>
<h1> Fairfield Tree Nurseries </h1>
</div>
</div>
<div class="arrow">
<div class="down-arrow"></div>
</div>
<div class="fw-content below">
<div class="fw-image">
<img src="https://s1.postimg.org/1lvq5tqycf/about-home.jpg" alt="Welcome to Fairfield Tree Nurseries">
</div>
<div class="cntr-type">
<h4 id="green"> We are a wholesale tree nursery producing field <br> grown nursery stock in the Lower Fraser Valley <br> community of Chilliwack, British Columbia. </h4>
<div class="btn" id="green-btn">
<a href="about.html">
<h3>Learn More</h3></a>
</div>
</div>
</div>
<div class="fw-content">
<div class="fw-image">
<img src="https://s1.postimg.org/51y1xx3dpr/field-wide.jpg" alt="Field wide angle">
</div>
<div class="cntr-type up">
<h4 class="shadow" id="white"> We offer an expanded product line to include a wide <br> range of field grown grafted conifers, specialty broadleaf <br> evergreen/deciduous shrubs and specimen plant material. </h4>
<div class="btn btn-shadow" id="white-btn">
<a href="products.html">
<h3 class="">Discover More</h3></a>
</div>
</div>
</div>
<div class="hw-content hide">
<div class="hw-left">
<div class="cntr-type cntr-type-special">
<h4 id="white"> Our products can be found throughout <br> North America and we pride ourselves in <br> providing expert service and support to all <br> of our clients, wherever they are. </h4>
<div class="btn" id="white-btn">
<a href="shipping.html">
<h3>Shipping Info</h3></a>
</div>
</div>
</div>
<div class="hw-right">
<img src="https://s1.postimg.org/2lbtizus33/leaves-sky-wide.jpg">
<div class="cntr-type cntr-type-special">
<h4 id="green"> We are located in the Lower <br> Fraser Valley community of Chilliwack, <br> British Columbia, Canada. </h4>
<div class="btn" id="green-btn">
<a href="location.html">
<h3>View Map</h3></a>
</div>
</div>
</div>
</div>
<div class="fw-content hidden-content empty bkg-green">
<div class="cntr-type">
<h4 id="white"> Our products can be found throughout <br> North America and we pride ourselves in <br> providing expert service and support to all <br> of our clients, wherever they are. </h4>
<div class="btn" id="white-btn">
<a href="shipping.html">
<h3>Shipping Info</h3></a>
</div>
</div>
</div>
<div class="fw-content hidden-content">
<div class="fw-image">
<img src="https://s1.postimg.org/2lbtizus33/leaves-sky-wide.jpg">
</div>
<div class="cntr-type">
<h4 id="green"> We are located in the Lower <br> Fraser Valley community of Chilliwack, <br> British Columbia, Canada. </h4>
<div class="btn" id="green-btn">
<a href="location.html">
<h3>View Map</h3></a>
</div>
</div>
</div>
<div class="fw-content empty">
<div class="cntr-type">
<h4 id="green"> For more information or to place an order please contact us, <br> we would love to hear from you. </h4>
<div class="btn" id="green-btn">
<a href="contact.html">
<h3>Contact Us</h3></a>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="footer-main">
<img src="https://s1.postimg.org/8ax5ukoq6n/logo-white.png">
<!--<div class="logo-footer">
</div> -->
<div class="title" style="color: white;"> Fairfield Tree Nurseries </div>
<nav class="navbar navfoot">
<ul>
<li>Home</li>
<li>About</li>
<li>Products</li>
<li>Shipping</li>
<li>Location</li>
<li>Contact</li>
</ul>
</nav>
</div>
</div>
<div class="copyright">
<p> © 2017 Fairfield Tree Nurseries Inc. All rights reserved.
</div>
</body>
And the CSS:
body {
margin: 0 auto;
font-family: "proxima-nova-alt", sans-serif;
text-align: center;
position: relative;
color: #707070;
}
/*================ NAV & HEADER STYLES + FOOTER ==================*/
.header {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
top: 0;
height: 120px;
padding: 15px 40px 15px 40px;
max-width: 1200px;
margin: 0 auto;
}
.header-border {
background-color: #009948;
height: 2px;
width: 100%;
}
.title {
font-size: 24px;
font-weight: 300;
color: #009948;
padding-left: 20px;
text-align: left;
}
.navbar {
margin-left: auto;
}
.navbar ul {
list-style: none;
margin: 0;
padding: 0;
}
.navbar li {
display: inline-block;
font-weight: 400;
font-size: 16px;
padding-left: 4vw;
}
.navbar a {
text-decoration: none;
color: #969696;
text-transform: uppercase;
letter-spacing: 2px;
transition: .3s color;
}
.navbar a:hover {
color: #009948;
}
.footer {
width: 100%;
max-width: 1200px;
background-color: #333;
}
.footer-main {
height: 200px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding: 20px 80px 0px 80px;
margin: 0 auto;
}
.footer h6 a {
transition: .3s color;
}
.footer h6 a:hover {
color: #009948;
}
.copyright {
height: 80px;
padding: 20px;
color: #505050;
background-color: rgba(10, 10, 10, .5);
padding: 40px 80px 10px 80px;
}
.copyright p {
text-align: left;
font-size: 16px;
letter-spacing: 1px;
font-weight: 400;
max-width: 1500px;
margin: 0 auto;
}
.navfoot a {
color: #707070;
transition: .3s color;
}
.navfoot a:hover {
color: white;
}
/*================ PAGES STYLES ===================*/
.main {
max-width: 1500px;
margin: 0 auto;
overflow: hidden;
}
/*=============== Home PAGE ================*/
.fw-content {
display: flex;
flex-direction: column;
width: 100%;
height: 600px;
align-items: center;
justify-content: center;
position: relative;
z-index: 3;
}
.fw-top {
border-top: 2px solid white;
}
.below {
margin-top: -30px;
position: relative;
z-index: 1;
}
.fw-image img {
max-height: 600px;
}
.hw-content {
display: flex;
flex-direction: row;
width: 100%;
height: 600px;
position: relative;
background-color: #009948;
max-width: 1500px;
margin: 0 auto;
margin-top: -2px;
}
.hw-left {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 50%;
}
.hw-right {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
width: 50%;
margin-left: auto;
}
.hw-right img {
height: 600px;
}
.cntr-type {
position: absolute;
left: auto;
}
.up {
margin-top: -60px;
}
.arrow {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
z-index: 2;
}
.down-arrow {
margin: -2px;
width: 0;
height: 0;
border-right: 30px solid transparent;
border-left: 30px solid transparent;
border-top: 30px solid #009948;
}
/*================ TEXT STYLES ===================*/
h1 {
font-size: 60px;
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
margin: 0;
}
h2 {
margin: 0;
font-size: 36px;
font-weight: 100;
letter-spacing: 2px;
color: white;
text-transform: uppercase;
}
h3 {
font-size: 12px;
font-weight: 300;
text-transform: uppercase;
letter-spacing: 2px;
margin: 0;
}
h4 {
font-size: 24px;
line-height: 36px;
font-weight: 300;
letter-spacing: 0.1px;
}
h5 {
text-align: left;
font-size: 24px;
font-weight: 400;
color: #009948;
margin: 10px 0 0 0;
letter-spacing: 1px;
}
h6 {
font-size: 16px;
letter-spacing: 2px;
text-transform: uppercase;
text-align: left;
margin: 20px 0 0 0;
}
p {
font-size: 20px;
line-height: 28px;
font-weight: 300;
letter-spacing: 0.1px;
text-align: left;
}
a {
text-decoration: none;
color: inherit;
}
.currentlink a {
color: #009948;
}
#green {
color: #009948;
}
#grey {
color: #2f2f2f;
}
#white {
color: #fff;
}
.shadow {
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}
/*================ BUTTON STYLES ====================*/
.btn {
width: 150px;
height: 30px;
margin: auto;
border: 2px solid;
border-radius: 20px;
line-height: 30px;
}
.btn a {
text-decoration: none;
}
#green-btn {
background-color: rgba(0, 153, 72, 0);
border-color: #009948;
color: #009948;
transition: .5s background-color, color;
margin-bottom: 15px;
}
#white-btn {
background-color: rgba(255, 255, 255, 0);
border-color: #fff;
color: #fff;
transition: .5s background-color, color;
}
#green-btn:hover {
border-color: #009948;
background-color: rgba(0, 153, 72, 1);
color: #fff;
}
#white-btn:hover {
border-color: #fff;
background-color: rgba(255, 255, 255, 1);
color: #009948;
text-shadow: none;
}
.btn-shadow {
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}
/*================================
RESPONSIVE Styling
================================*/
#media screen and (min-width:500px) {
.hidden-content {
display: none;
}
}
#media screen and (max-width:500px) {
.header {
flex-direction: column;
height: inherit;
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
}
.title {
text-align: center;
width: 100%;
padding: 0;
margin-top: 10px;
}
.navbar {
margin: 15px 0 0 0;
width: 100%;
padding: 0;
}
.navbar ul {
display: flex;
flex-direction: column;
}
.navbar li {
font-weight: 400;
padding: 7.5px 0 7.5px 0;
border-top: 2px solid #009948;
width: 100%;
}
.navbar a {
text-decoration: none;
width: inherit;
margin: 100px;
}
.navbar a:active {
background-color: white;
color: #009948;
}
.navtop {
padding: 10px 0 0 0;
}
.main {
overflow: hidden;
}
.arrow {
margin-top: -4px;
}
.cntr-type {
padding: 0 5%;
}
.up {
margin-top: 0px;
}
.btn {
width: 120px;
height: 30px;
margin: auto;
border: 2px solid;
border-radius: 20px;
line-height: 30px;
}
.btn-shadow {
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
box-shadow: inset 2px 2px 40px rgba(255, 255, 255, 0.5);
}
.hide {
display: none;
}
.hidden-content {
display: flex;
}
.footer {
flex-direction: column;
justify-content: center;
height: inherit;
padding-left: 0;
padding-right: 0;
padding-bottom: 5px;
}
.footer-main {
display: flex;
flex-direction: column;
padding: 30px 0 0 0;
height: inherit;
}
.navfoot {
background-color: #707070;
padding: 0px;
}
.navfoot li {
border-color: #333;
}
.navfoot a {
color: #333;
}
.copyright {
padding: 20px 0 0 0;
}
.copyright p {
width: 80%;
}
.questions {
padding-top: 0;
}
.question-box {
margin-top: 30px;
}
/*==============FONT STYLES==============*/
h1 {
font-size: 36px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 10px;
font-weight: 400;
}
h4 {
font-size: 16px;
line-height: 24px;
}
br {
display: none;
}
p {
font-size: 18px;
}
}
#media screen and (max-width:1024px) and (min-width:500px) {
.header {
flex-direction: column;
padding: 20px 0 0 0;
height: inherit;
}
.navbar {
margin: 0;
}
.navtop {
padding: 10px 0 0 0;
}
.title {
margin: 10px 0 10px 0;
}
}
#media screen and (max-width:1024px) {
.fw-content {
height: inherit;
overflow: hidden;
}
.fw-image {
height: inherit;
}
.fw-image img {
width: auto;
height: 45vh;
display: flex;
justify-content: space-between;
}
.fw-top {
border: none;
}
.cntr-type {
padding: 0 10%;
}
.cntr-type-special {
padding: 0;
width: 300px;
}
.cntr-type-special h4 {
font-size: 20px;
line-height: 32px;
}
.empty {
height: 60vh;
}
.empty-s {
height: 40vh;
}
h4 br {
display: none;
}
.question-mark {
margin-top: -30px;
}
}
#media screen and (min-width: 501px) {
.navtop {
padding: 10px 0 10px 0;
}
}
#media screen and (max-width: 700px) {
.bkg-green {
background-color: #009948;
}
.hw-contact .contact-info {
display: none;
}
.contact-info {
width: 75%;
}
.fw-contact {
padding: 15px 0 25px 0;
}
.contact-form {
width: 100%;
}
.contact-form form {
width: 90%;
}
}
#media screen and (min-width:700px) {
.hidden-content2 {
display: none;
}
}
#media screen and (min-width:1240px) {
.header {
max-width: none;
}
.footer {
max-width: none;
}
}
#media screen and (min-width:1580px) {
.header {
padding: 15px 0 15px 0;
max-width: 1500px;
}
.footer-main {
max-width: 1500px;
}
.copyright {}
}
You are adding the hidden-content and hide classes which have display: none in them.

Sticky Footer floating in page when resizing (reasked)

This question was posted a few years ago By Sally but she solved it herself and her solution is not working for me.
I have gone through practically all of the relevant sticky footer pages on this site and a bunch from other places but I cannot find anything answering this question. I am sure it has to do with my layout but I have tried every way I have researched and can think of and this is the closest I could get to a sticky footer I am happy with.
Here is the HTML I am working with.
<body>
<div id="container">
<header class="main-header">
<img src="logo3.png" alt="logo" />
<ul class="main-nav">
<li><a id="home" href="index.html">Home</a>
</li>
</ul>
<ul class="second-nav">
<li><a id="about" href="About.html">About Us</a>
</li>
<li><a id="portfolio" href="Portfolio.html">Portfolio</a>
</li>
<li>Sports Complex
</li>
<li>Contact Us
</li>
</ul>
</header>
<body class="body">
<div class="frameT">
<div class="frameTC">
<div class="thumb" id="thumbs">
<a id="single_image1" href=".html"><img src="http://placehold.it/300x300" alt="" />
<span class="caption">_______</span>
</a>
<a id="single_image1" href=".html"><img src="http://placehold.it/300x300" alt="" />
<span class="caption">________</span>
</a>
<a id="single_image1" href=".html"><img src="http://placehold.it/300x300" alt="" />
<span class="caption">________</span>
</a>
<span class="stretch"></span>
</div>
</div>
</div>
</body>
<footer class="footer">
<div class="quote">
<h6>""</h6>
<p> - </p>
</div>
</footer>
</div>
</body>
and the CSS
/*header*/
.main-header {
display: inline-block;
position: relative;
margin: 1%;
width: 98%;
top: 0;
left: 0;
min-width: 904px;
z-index: 10;
border: 0px solid #2675a9;
border-top: none;
border-radius: 0 0 0 0;
background-color: #606060;
background-color: rgb(29, 67, 129);
-webkit-box-shadow:0 1px 5px black;
-moz-box-shadow:0 1px 5px black;
box-shadow:0 1px 5px black;
}
.main-header:after {
content: " ";
display: table;
clear: both;
}
.main-header li {
display: inline;
}
.main-header img {
position: relative;
float: left;
top: 5.5px;
left: 5.5px;
width: 60px;
height: 60px;
}
.main-nav {
float: left;
margin: 12.5px 0 12.5px 5px;
padding: 0;
}
.main-nav a {
text-shadow: 0.06em 0.08em #2666b1;
letter-spacing: 4px;
color: #ebebeb;
font-family: StonyIsland;
display: block;
font-size: 2.5em;
padding: 0px 10px;
text-decoration: none;
margin: 0px;
font-weight: 300;
}
.logo {
height: 50px;
width: 50px;
top: 0;
left: 0;
padding: 10.5px;
margin: 0;
}
.second-nav {
float: right;
border-radius: 4px;
margin-bottom: 5px;
margin-top: 5px;
margin-left: 0;
margin-right: 0;
border: none;
padding: 9.5px;
}
.second-nav > li {
float: left;
border: solid 1px #ebebeb;
border-bottom: none;
border-top: none;
border-right: none;
}
.second-nav li:first-child {
border-left: none;
}
.second-nav li:second-child {
border-left: none;
}
.second-nav a {
color: #ebebeb;
display: block;
font-family: Capsuula;
font-size: 1.13em;
padding: 10px 30px;
text-decoration: none;
}
a:hover{
text-shadow: none;
color: rgb(237, 12, 12);
}
/*body*/
html {
position: relative;
height: 100%;
overflow-x: hidden;
}
ul {
list-style-type: none;
}
a {
text-decoration: none;
font-size: 1.5em;
}
#wrap {
min-height: 100%;
}
#main {
padding-bottom: 60px;
}
body {
height: 100%;
margin: 0 0 60px;
background-color: rgb(255, 255, 255);
}
/*body location*/
#thumbs {
width: auto;
margin: 0;
text-align: center;
-ms-text-justify: distribute-all-lines;
text-justify: distribute-all-lines;
}
#thumbs a {
vertical-align: top;
display: inline-block;
*display: inline;
zoom: 1;
margin-left: 2%;
margin-right: 2%;
margin-bottom: 4em;
margin-top: 12%;
}
#thumbs img {
width: 300px;
height: 300px;
background-color: grey;
border-radius: 60px;
box-shadow: 0 1px 20px black;
}
.caption {
display: block;
}
/*footer*/
footer {
position: absolute;
left: 0;
bottom: 0;
height: 60px;
width: 100%;
background-color: rgba(255, 255, 255) transparent;
background-color: rgba(255, 255, 255, 0.5);
}
.footer .quote {
float: right;
color: rgb(56, 56, 56);
}
.footer h6 {
font-size: 15px;
font-family: Capsuula;
margin: 0;
padding: 7px;
}
.footer p {
font-size: 21px;
font-family: Capsuula;
float: right;
margin: 0;
padding;
5px;
padding-right: 12px;
}
Here is my JSfiddle
In my normal full screen the three 300px x 300px squares fit in a line and everything is well and good but when the window size is reduced (like the one in my fiddle) the squares turn into two lines and are pushed off the screen. The footer stays in place at the bottom of the screen until you scroll then it just stays put and does not follow the bottom of the page.
I would like the footer to either get pushed to the bottom of the screen when the squares get forced into two lines.
-or-
Stay at the bottom of the screen and scroll with the user.
Any help would be very much appreciate!
I removed the excess body and turned it into a div. I ended the container before the footer and added a push div, equal in height to the footer. Seems to work now. Check out the fiddle
/*header*/
.main-header {
display: inline-block;
position: relative;
margin: 1%;
width: 98%;
top: 0;
left: 0;
min-width: 904px;
z-index: 10;
border: 0px solid #2675a9;
border-top: none;
border-radius: 0 0 0 0;
background-color: #606060;
background-color: rgb(29, 67, 129);
-webkit-box-shadow:0 1px 5px black;
-moz-box-shadow:0 1px 5px black;
box-shadow:0 1px 5px black;
}
.main-header:after {
content:" ";
display: table;
clear: both;
}
.main-header li {
display: inline;
}
.main-header img {
position: relative;
float: left;
top: 5.5px;
left: 5.5px;
width: 60px;
height: 60px;
}
.main-nav {
float: left;
margin: 12.5px 0 12.5px 5px;
padding: 0;
}
.main-nav a {
text-shadow: 0.06em 0.08em #2666b1;
letter-spacing: 4px;
color: #ebebeb;
font-family: StonyIsland;
display: block;
font-size: 2.5em;
padding: 0px 10px;
text-decoration: none;
margin: 0px;
font-weight: 300;
}
.logo {
height: 50px;
width: 50px;
top: 0;
left: 0;
padding: 10.5px;
margin: 0;
}
.second-nav {
float: right;
border-radius: 4px;
margin-bottom: 5px;
margin-top: 5px;
margin-left: 0;
margin-right: 0;
border: none;
padding: 9.5px;
}
.second-nav > li {
float: left;
border: solid 1px #ebebeb;
border-bottom: none;
border-top: none;
border-right: none;
}
.second-nav li:first-child {
border-left: none;
}
.second-nav li:second-child {
border-left: none;
}
.second-nav a {
color: #ebebeb;
display: block;
font-family: Capsuula;
font-size: 1.13em;
padding: 10px 30px;
text-decoration: none;
}
a:hover {
text-shadow: none;
color: rgb(237, 12, 12);
}
/*body*/
html {
position: relative;
height: 100%;
overflow-x: hidden;
}
ul {
list-style-type: none;
}
a {
text-decoration: none;
font-size: 1.5em;
}
#wrap {
min-height: 100%;
}
#main {
padding-bottom: 60px;
}
body {
height: 100%;
margin: 0 0 60px;
background-color: rgb(255, 255, 255);
}
/*body location*/
#thumbs {
width: auto;
margin: 0;
text-align: center;
-ms-text-justify: distribute-all-lines;
text-justify: distribute-all-lines;
}
#thumbs a {
vertical-align: top;
display: inline-block;
*display: inline;
zoom: 1;
margin-left: 2%;
margin-right: 2%;
margin-bottom: 4em;
margin-top: 12%;
}
#thumbs img {
width: 300px;
height: 300px;
background-color: grey;
border-radius: 60px;
box-shadow: 0 1px 20px black;
}
.caption {
display: block;
}
/*footer*/
.push{height:60px;}
footer {
position: relative;
left: 0;
bottom: 0;
height: 60px;
width: 100%;
background-color: rgba(255, 255, 255) transparent;
background-color: rgba(255, 255, 255, 0.5);
}
footer .quote {
float: right;
color: rgb(56, 56, 56);
}
footer h6 {
font-size: 15px;
font-family: Capsuula;
margin: 0;
padding: 7px;
}
footer p {
font-size: 21px;
font-family: Capsuula;
float: right;
margin: 0;
padding;
5px;
padding-right: 12px;
}
<body>
<div id="container">
<header class="main-header"> <img src="logo3.png" alt="logo" />
<ul class="main-nav">
<li><a id="home" href="index.html">Home</a>
</li>
</ul>
<ul class="second-nav">
<li><a id="about" href="About.html">About Us</a>
</li>
<li><a id="portfolio" href="Portfolio.html">Portfolio</a>
</li>
<li>Sports Complex
</li>
<li>Contact Us
</li>
</ul>
</header>
<div class="body">
<div class="frameT">
<div class="frameTC">
<div class="thumb" id="thumbs"> <a id="single_image1" href=".html"><img src="http://placehold.it/300x300" alt="" />
<span class="caption">_______</span>
</a>
<a id="single_image1" href=".html"><img src="http://placehold.it/300x300" alt="" />
<span class="caption">________</span>
</a>
<a id="single_image1" href=".html"><img src="http://placehold.it/300x300" alt="" />
<span class="caption">________</span>
</a>
<span class="stretch"></span>
</div>
</div>
</div>
</div>
</div>
<div class="push"></div>
<footer class="footer">
<div class="quote">
<h6>"Hello"</h6>
<p>-</p>
</div>
</footer>
</body>