The problem is the about section. I want the home_about_box to be on-top of a background image. Here is a quick sketch:
I am very new to this, so if you have the fix, I would appreciate both getting the code, and a good explanation on what I have done wrong.
Thanks, and don´t be shy to criticise my code, as long as it´s constructive criticism!
#import url('https://fonts.googleapis.com/css?family=Lato:300,400,700,900');
* {
box-sizing: border-box;
transition: all ease-in-out 250ms;
}
body {
margin: 0;
font-family: "Lato", sans-serif;
text-align: center;
}
img {
max-width: 100%;
height: auto;
padding: 1em 0 1em;
background-size: cover;
}
.container {
width: 100%;
margin: 0 auto;
}
/* Header
========= */
header {
position: absolute;
width: 100%;
}
nav ul {
margin: 0;
padding: 1em 0;
list-style: none;
}
nav li {
display: inline-block;
margin: .5em
}
nav a {
font-weight: 900;
text-decoration: none;
text-transform: uppercase;
font-size: .9rem;
padding: .5em;
color: #FFF;
}
nav a:hover,
nav a:focus {
color: #DDD;
}
#media (min-width: 60rem) {
.logo {
float: left;
text-align: center;
align-content: center;
}
nav {
float: right;
text-align: center;
margin-right: 1em;
}
}
/* Buttons
========== */
.button_top {
display: inline-block;
font-size: 1.3rem;
text-decoration: none;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
border-color: #174FC1;
padding: .5em 1em;
color: #FFF;
}
.button_top:hover,
.button_top:focus {
background: #174FC1;
color: #FFF;
}
.button_dark {
display: inline-block;
font-size: 1.3rem;
text-decoration: none;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
border-color: #FFF;
padding: .5em 1em;
color: #FFF;
margin-bottom: 1em;
}
.button_dark:hover,
.button_dark:focus {
background: #FFF;
color: #000;
}
#media (min-width: 25rem) {
.button_top {
font-size: 1.7rem;
padding: .3em 1em
}
}
#media (min-width: 60rem) {
.button_top {
font-size: 2.4rem;
padding: .3em 1em;
margin-top: -1em;
}
}
#media (min-width: 25rem) {
.button_dark {
font-size: 1.7rem;
padding: .3em 1em
}
}
#media (min-width: 60rem) {
.button_dark {
font-size: 2rem;
padding: .3em 1em;
}
}
.clearfix::after,
section::after,
footer::after {
content: "";
display: block;
clear: both;
}
/* Typography
========= */
.title {
font-size: 2rem;
margin-bottom: 1.6em;
margin-top: 5em;
}
.title span {
font-weight: 300;
display: block;
font-size: 1.3rem;
}
.title-cta {
margin: 0 0 1em;
}
#media (min-width: 60rem) {
.title {
font-size: 4rem;
margin-top: 1.5em;
}
}
h1 {
font-weight: 800;
margin-top: 0;
}
.unstyled-list {
margin: 0;
padding: 1.3em;
list-style-type: none;
text-align: left;
}
/* Home.hero
========= */
.home-hero {
background-image: url(https://i.imgur.com/yUFKqAe.jpg);
background-size: cover;
background-position: center;
padding: 1em;
color: #FFF;
width: 100%;
height: 100vh;
}
#media (min-width: 25rem) {
.home-hero {
width: 100%;
height: 100vh;
}
}
#media (min-width: 60rem) {
.home-hero {
width: 100%;
height: auto;
}
}
#media (min-height: 30rem) {
.home-hero {
width: 100%;
height: 100vh;
}
}
/*Home About */
.home_about_box {
background-color: #232323;
font-size: .8em;
padding: 4em;
outline: 2px solid #174fc1;
outline-offset: -3em;
color: #FFF;
position: relative
}
.home_about_box h1 {
color: #174fc1;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 1.3em;
background: #232323;
padding: 0 0.5em
}
#media (min-width: 25rem) {
h1 {
font-size: 1.6rem;
}
.home_about_box h1 {
top: 1.3rem;
}
}
#media (min-width: 60rem) {
h1 {
font-size: 1.2rem;
}
.about.bg {
background-image: url(https://i.imgur.com/aTF2hwR.jpg);
padding: 5em;
}
.home_about_box {
background-color: #232323;
font-size: 0.8em;
padding: 4em;
outline: 2px solid #174fc1;
outline-offset: -3em;
color: #fff;
z-index: 101;
width: 25em;
margin-left: 52em;
}
.home_about_box h1 {
top: 1.5rem;
}
}
/* portfolio
*/
.portfolio_home {
margin: 1.8em 0 0;
background-size: cover;
}
.portfolio_home h1 {
color: #174FC1;
font-size: 3em;
margin: auto;
padding: 0 0 .3em 0;
}
.port-item {
margin: 0;
position: relative;
}
.port-item img {
display: block;
}
.port-desc {
position: absolute;
z-index: 100;
bottom: 0em;
left: 0em;
right: 0em;
color: #FFF;
background: rgba(0, 0, 0, .75);
padding-bottom: 1em;
padding-top: 1em;
}
.port-desc p {
margin: .5em;
background-size: 100% 100%;
}
#media (min-width: 40rem) {
.port-item {
width: 50%;
float: left;
}
}
#media (min-width: 60rem) {
.port-item {
width: 33.3333334%;
float: left;
overflow: hidden
}
.port-desc {
transform: translateY(150%);
}
.port-item:hover .port-desc {
transform: translateY(0%)
}
.port-item img {
max-width: 100%;
height: auto;
padding: 0 0 0;
background-size: cover;
}
}
/* CTA
*/
.cta {
background-color: #174fc1;
padding: 0.1em;
}
.cta h1 {
margin-top: 1em;
color: #FFF
}
/* Footer */
footer {
background: #232323;
color: #FFF;
}
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tobias Barsnes</title>
<link href="home.css" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("a").on('click', function(event) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 900, function() {
window.location.hash = hash;
});
}
});
});
</script>
</head>
<body>
<header>
<img class="logo" src="https://i.imgur.com/o3Mmqvq.png" width="100" height="89" alt="">
<nav>
<ul>
<li>Home</li>
<li>Portfolio</li>
<li>Contact</li>
</ul>
</nav>
</header>
<section class="home-hero">
<div class="container">
<h1 class="title">Tobias Barsnes
<span>Portfolio</span>
</h1>
Take a look
</div>
</section>
<section class="home.about">
<div class="about.bg">
<div class="home_about_box">
<h1>About Myself</h1>
<p>I am a 16 year old boy from Norway. My whole life I have been interested in graphical design, and I am currently studying "Medium and Communications".</p>
<p>A big goal for me is to get a job that has to do with graphical design. I have experience dating all the way back to 2012, but I am still in the "learning phase".</p>
</div>
</div>
</section>
<section class="portfolio_home" id="portfolio">
<h1>Some of my work</h1>
<figure class="port-item">
<!-- Portfolio 1 -->
<img src="https://i.imgur.com/eBRYWII.png" alt="portfolio item" />
<figcaption class="port-desc">
<p>Geofilters</p>
</figcaption>
</figure>
<!-- Portfolio 2 -->
<figure class="port-item">
<img src="https://i.imgur.com/gAfgliA.png" alt="portfolio item" />
<figcaption class="port-desc">
<p>Quixz eSports</p>
</figcaption>
</figure>
<!-- Portfolio 3 -->
<figure class="port-item">
<img src="https://i.imgur.com/IjoGmUT.png" alt="portfolio item" />
<figcaption class="port-desc">
<p>3D Renders</p>
</figcaption>
</figure>
<!-- Portfolio 4 -->
<figure class="port-item">
<img src="https://i.imgur.com/4zymXa8.png" alt="portfolio item" />
<figcaption class="port-desc">
<p>Backgrounds</p>
</figcaption>
</figure>
</section>
<section class="cta">
<div class="container">
<h1 class="title title-cta">Want to see more?
<span>Then what are you waiting for?</span>
</h1>
See More
</div>
</section>
<footer>
<section class="home-foot">
<ul class="unstyled-list">
<li> <strong>Website crafted by Tobias Barsnes</strong></li>
</ul>
</section>
</footer>
</body>
</html>
you just need to change this line
<div class="about.bg">
to this
<div class="about bg">
and it will work,
Note:
<div class="class1.text"></div>
is incorrect syntax, you can write it like this
<div class="class1-text"></div>
if u apply your css like
.class1.text{}
it means you have 2 classes in a div and u want to select them like
my above selector will select this element
check below code in full preview mode
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tobias Barsnes</title>
<style>
#import
url('https://fonts.googleapis.com/css?family=Lato:300,400,700,900');
* {
box-sizing: border-box;
transition: all ease-in-out 250ms;
}
body {
margin: 0;
font-family: "Lato", sans-serif;
text-align: center;
}
img {
max-width: 100%;
height: auto;
padding: 1em 0 1em;
background-size: cover;
}
.container {
width: 100%;
margin: 0 auto;
}
/* Header
========= */
header {
position: absolute;
width: 100%;
}
nav ul {
margin: 0;
padding: 1em 0;
list-style: none;
}
nav li {
display: inline-block;
margin: .5em
}
nav a {
font-weight: 900;
text-decoration: none;
text-transform: uppercase;
font-size: .9rem;
padding: .5em;
color: #FFF;
}
nav a:hover,
nav a:focus{
color: #DDD;
}
#media (min-width: 60rem) {
.logo{
float: left;
text-align: center;
align-content: center;
}
nav{
float: right;
text-align: center;
margin-right: 1em;
}
}
/* Buttons
========== */
.button_top {
display: inline-block;
font-size: 1.3rem;
text-decoration: none;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
border-color: #174FC1;
padding: .5em 1em;
color: #FFF;
}
.button_top:hover,
.button_top:focus {
background: #174FC1;
color: #FFF;
}
.button_dark {
display: inline-block;
font-size: 1.3rem;
text-decoration: none;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
border-color: #FFF;
padding: .5em 1em;
color: #FFF;
margin-bottom: 1em;
}
.button_dark:hover,
.button_dark:focus {
background: #FFF;
color: #000;
}
#media (min-width: 25rem) {
.button_top {
font-size: 1.7rem;
padding: .3em 1em
}
}
#media (min-width: 60rem) {
.button_top {
font-size: 2.4rem;
padding: .3em 1em;
margin-top: -1em;
}
}
#media (min-width: 25rem) {
.button_dark {
font-size: 1.7rem;
padding: .3em 1em
}
}
#media (min-width: 60rem) {
.button_dark {
font-size: 2rem;
padding: .3em 1em;
}
}
.clearfix::after,
section::after,
footer::after{
content: "";
display: block;
clear: both;
}
/* Typography
========= */
.title {
font-size: 2rem;
margin-bottom: 1.6em;
margin-top: 5em;
}
.title span {
font-weight: 300;
display: block;
font-size: 1.3rem;
}
.title-cta {
margin: 0 0 1em;
}
#media (min-width: 60rem) {
.title{
font-size: 4rem;
margin-top: 1.5em;
}
}
h1 {
font-weight: 800;
margin-top: 0;
}
.unstyled-list {
margin: 0;
padding: 1.3em;
list-style-type: none;
text-align: left;
}
/* Home.hero
========= */
.home-hero {
background-image: url(https://i.imgur.com/yUFKqAe.jpg);
background-size: cover;
background-position: center;
padding: 1em;
color: #FFF;
width: 100%;
height: 100vh;
}
#media (min-width: 25rem) {
.home-hero{
width: 100%;
height: 100vh;
}
}
#media (min-width: 60rem) {
.home-hero{
width: 100%;
height: auto;
}
}
#media (min-height: 30rem) {
.home-hero{
width: 100%;
height: 100vh;
}
}
/*Home About */
.home_about_box {
background-color: #232323;
font-size: .8em;
padding: 4em;
outline: 2px solid #174fc1;
outline-offset: -3em;
color: #FFF;
position: relative
}
.home_about_box h1 {
color: #174fc1;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 1.3em;
background: #232323;
padding: 0 0.5em
}
#media (min-width: 25rem) {
h1 {
font-size: 1.6rem;
}
.home_about_box h1 {
top: 1.3rem;
}
}
#media (min-width: 60rem) {
h1 {
font-size: 1.2rem;
}
.about.bg {
background-image: url(https://i.imgur.com/aTF2hwR.jpg);
padding: 5em;
}
.home_about_box {
background-color: #232323;
font-size: 0.8em;
padding: 4em;
outline: 2px solid #174fc1;
outline-offset: -3em;
color: #fff;
z-index: 101;
width: 25em;
margin-left: 52em;
}
.home_about_box h1 {
top: 1.5rem;
}
}
/* portfolio
*/
.portfolio_home {
margin: 1.8em 0 0;
background-size: cover;
}
.portfolio_home h1 {
color: #174FC1;
font-size: 3em;
margin: auto;
padding: 0 0 .3em 0;
}
.port-item {
margin: 0;
position: relative;
}
.port-item img {
display: block;
}
.port-desc {
position: absolute;
z-index: 100;
bottom: 0em;
left: 0em;
right: 0em;
color: #FFF;
background: rgba(0,0,0,.75);
padding-bottom: 1em;
padding-top: 1em;
}
.port-desc p {
margin: .5em;
background-size: 100% 100%;
}
#media (min-width: 40rem) {
.port-item {
width: 50%;
float: left;
}
}
#media (min-width: 60rem) {
.port-item {
width: 33.3333334%;
float: left;
overflow: hidden
}
.port-desc {
transform: translateY(150%);
}
.port-item:hover .port-desc {
transform: translateY(0%)
}
.port-item img {
max-width: 100%;
height: auto;
padding: 0 0 0;
background-size: cover;
}
}
/* CTA
*/
.cta{
background-color: #174fc1;
padding: 0.1em;
}
.cta h1 {
margin-top: 1em;
color: #FFF
}
/* Footer */
footer {
background: #232323;
color: #FFF;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("a").on('click', function(event) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 900, function(){
window.location.hash = hash;
});
}
});
});
</script>
</head>
<body>
<header>
<img class="logo" src="https://i.imgur.com/o3Mmqvq.png" width="100" height="89" alt="">
<nav>
<ul>
<li>Home</li>
<li>Portfolio</li>
<li>Contact</li>
</ul>
</nav>
</header>
<section class="home-hero">
<div class="container">
<h1 class="title">Tobias Barsnes
<span>Portfolio</span>
</h1>
Take a look
</div>
</section>
<section class="home.about">
<div class="about bg">
<div class="home_about_box">
<h1>About Myself</h1>
<p>I am a 16 year old boy from Norway. My whole life I have been interested in graphical design, and I am currently studying "Medium and Communications".</p>
<p>A big goal for me is to get a job that has to do with graphical design. I have experience dating all the way back to 2012, but I am still in the "learning phase".</p>
</div>
</div>
</section>
<section class="portfolio_home" id="portfolio">
<h1>Some of my work</h1>
<figure class="port-item">
<!-- Portfolio 1 -->
<img src="https://i.imgur.com/eBRYWII.png" alt="portfolio item"/>
<figcaption class="port-desc">
<p>Geofilters</p>
</figcaption>
</figure>
<!-- Portfolio 2 -->
<figure class="port-item">
<img src="https://i.imgur.com/gAfgliA.png" alt="portfolio item"/>
<figcaption class="port-desc">
<p>Quixz eSports</p>
</figcaption>
</figure>
<!-- Portfolio 3 -->
<figure class="port-item">
<img src="https://i.imgur.com/IjoGmUT.png" alt="portfolio item"/>
<figcaption class="port-desc">
<p>3D Renders</p>
</figcaption>
</figure>
<!-- Portfolio 4 -->
<figure class="port-item">
<img src="https://i.imgur.com/4zymXa8.png" alt="portfolio item"/>
<figcaption class="port-desc">
<p>Backgrounds</p>
</figcaption>
</figure>
</section>
<section class="cta">
<div class="container">
<h1 class="title title-cta">Want to see more?
<span>Then what are you waiting for?</span>
</h1>
See More
</div>
</section>
<footer>
<section class="home-foot">
<ul class="unstyled-list">
<li> <strong>Website crafted by Tobias Barsnes</strong></li>
</ul>
</section>
</footer>
</body>
</html>
I'm not sure if this is what you want but try this CSS code:
.home_about_box {
background-color: transparent;
font-size: .8em;
padding: 4em;
outline: 2px solid #174fc1;
outline-offset: -3em;
color: #FFF;
position: absolute;
z-index:500;
margin-top:-25%;
;
}
Here's a fiddle: https://jsfiddle.net/er8qhrhL/
Related
So I have my personal website and I have paragraphs within it. When viewed on a large screen it looks fine however on a phone it is in a single column and I would like to fix that. I have a screen shot with what I mean and a code pen with the code. I have tried using #media screen and (mad-width:) however it does not help.
#media only screen and (max-width: 500px) {
.masthead {
padding: 3em 0;
}
#media screen and (max-width: 600px) {
.column-left {
display: none;
}
}
#media screen and (max-width: 1800px) {
.button {
display: none;
}
}
.masthead-heading {
font-size: 3em;
}
.content-footer {
padding: 2em 2.5em;
}
}
.about,
.about-content,
.skills,
.skills-content,
.title::after,
.text {
color: white;
}
.navbar {
background-color: #ac5fdb;
color-scheme: 100%;
}
.content-footer {
padding: 2px 0;
text-align: center;
background-color: #ac5fdb;
color-scheme: 100%;
text-decoration: none;
max-height: 2000px;
}
.footer-text {
padding-bottom: 70px;
}
.content-footer>p {
color: grey;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
text-decoration: none;
}
html {
scroll-behavior: smooth;
background-color: #1e2029;
}
/* custom scroll bar */
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
/* all similar content styling codes */
section {
padding: 100px 0;
}
.max-width {
max-width: 1300px;
padding: 0 80px;
margin: auto;
}
.about,
.services,
.skills,
.teams,
.contact,
footer {
font-family: "Poppins", sans-serif;
}
.about .about-content,
.services .serv-content,
.skills .skills-content,
.contact .contact-content {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
section .title {
position: relative;
text-align: center;
font-size: 40px;
font-weight: 500;
margin-bottom: 60px;
padding-bottom: 20px;
font-family: "Ubuntu", sans-serif;
}
section .title::before {
content: "";
position: absolute;
bottom: 0px;
left: 50%;
width: 180px;
height: 3px;
background: #1e2029;
transform: translateX(-50%);
}
section .title::after {
position: absolute;
bottom: -8px;
left: 50%;
font-size: 20px;
color: #ac5fdb;
padding: 0 5px;
background: #1e2029;
transform: translateX(-50%);
}
/* navbar styling */
.nav-link {
color: #fff;
}
.navbar {
position: fixed;
width: 100%;
z-index: 999;
padding: 30px 0;
font-family: "Ubuntu", sans-serif;
transition: all 0.3s ease;
}
.navbar.sticky {
padding: 15px 0;
background: #ac5fdb;
}
.navbar .max-width {
display: flex;
align-items: center;
justify-content: space-between;
}
.navbar .logo a {
color: #fff;
font-size: 35px;
font-weight: 600;
}
.navbar .logo a span {
color: #ac5fdb;
transition: all 0.3s ease;
}
.navbar.sticky .logo a span {
color: #fff;
}
.navbar .menu li {
list-style: none;
display: inline-block;
}
.navbar .menu li a {
display: block;
color: #fff;
font-size: 18px;
font-weight: 500;
margin-left: 25px;
transition: color 0.3s ease;
}
.navbar .menu li a:hover {
color: #ac5fdb;
}
.navbar.sticky .menu li a:hover {
color: #ffff;
}
/* menu btn styling */
.menu-btn {
color: #fff;
font-size: 23px;
cursor: pointer;
display: none;
}
.scroll-up-btn {
position: fixed;
height: 45px;
width: 42px;
background: #ac5fdb;
right: 30px;
bottom: 10px;
text-align: center;
line-height: 45px;
color: #fff;
z-index: 9999;
font-size: 30px;
border-radius: 6px;
border-bottom-width: 2px;
cursor: pointer;
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.scroll-up-btn.show {
bottom: 30px;
opacity: 1;
pointer-events: auto;
}
.scroll-up-btn:hover {
filter: brightness(90%);
}
/* home section styling */
.home {
display: flex;
background: url("/Files/banner.jpg");
height: 90vh;
color: #fff;
min-height: 90vh;
background-size: cover;
background-attachment: fixed;
font-family: "Ubuntu", sans-serif;
}
.home .max-width {
width: 100%;
display: flex;
}
.home .max-width .row {
margin-right: 0;
}
.home .home-content .text-1 {
font-size: 27px;
}
.home .home-content .text-2 {
font-size: 75px;
font-weight: 600;
margin-left: -3px;
}
.home .home-content .text-3 {
font-size: 40px;
margin: 5px 0;
}
.home .home-content .text-3 span {
color: #ac5fdb;
font-weight: 500;
}
.home .home-content a {
display: inline-block;
background: #ac5fdb;
color: #fff;
font-size: 25px;
padding: 12px 36px;
margin-top: 20px;
font-weight: 400;
border-radius: 6px;
border: 2px solid #ac5fdb;
transition: all 0.3s ease;
}
.home .home-content a:hover {
color: #ac5fdb;
background: none;
}
/* about section styling */
.about .title::after {
content: "who I am";
}
.about .about-content .left {
width: 45%;
}
.about .about-content .column-left img {
height: 400px;
width: 400px;
object-fit: cover;
border-radius: 6px;
}
.about .about-content .right {
width: 55%;
}
.about .about-content .right .text {
font-size: 25px;
font-weight: 600;
margin-bottom: 10px;
}
.about .about-content .right .text span {
color: #ac5fdb;
}
.about .about-content .right p {
text-align: justify;
}
.about .about-content .right a {
display: inline-block;
background: #ac5fdb;
color: #fff;
font-size: 20px;
font-weight: 500;
padding: 10px 30px;
margin-top: 20px;
border-radius: 6px;
border: 2px solid #ac5fdb;
transition: all 0.3s ease;
}
.about .about-content .right a:hover {
color: #ac5fdb;
background: none;
}
/* skills section styling */
.skills .title::after {
content: "what i know";
}
.skills .skills-content .column {
width: calc(50% - 30px);
}
.skills .skills-content .left .text {
font-size: 20px;
font-weight: 600;
margin-bottom: 10px;
}
.skills .skills-content .left p {
text-align: justify;
}
.skills .skills-content .left a {
display: inline-block;
background: #ac5fdb;
color: #fff;
font-size: 18px;
font-weight: 500;
padding: 8px 16px;
margin-top: 20px;
border-radius: 6px;
border: 2px solid #ac5fdb;
transition: all 0.3s ease;
}
.skills .skills-content .left a:hover {
color: #ac5fdb;
background: none;
}
.skills .skills-content .right .bars {
margin-bottom: 15px;
}
.skills .skills-content .right .info {
display: flex;
margin-bottom: 5px;
align-items: center;
justify-content: space-between;
}
.skills .skills-content .right span {
font-weight: 500;
font-size: 18px;
}
.skills .skills-content .right .line {
height: 5px;
width: 100%;
background: lightgrey;
position: relative;
}
.skills .skills-content .right .line::before {
content: "";
position: absolute;
height: 100%;
left: 0;
top: 0;
background: #ac5fdb;
}
.skills-content .right .html::before {
width: 100%;
}
.skills-content .right .css::before {
width: 90%;
}
.skills-content .right .js::before {
width: 75%;
}
.skills-content .right .php::before {
width: 70%;
}
.skills-content .right .mysql::before {
width: 50%;
}
/* services section styling */
.contact {
background-color: #1e2029;
}
.title,
.head,
.text {
color: #fff;
}
.services,
.teams {
color: #fff;
background-color: #1e2029;
}
.services .title::before,
.teams .title::before {
background-color: #1e2029;
color: #ffff;
}
.services .title::after,
.teams .title::after {
background: #111;
content: "what I've made";
}
.services .serv-content .card {
width: calc(33% - 20px);
background: #222;
text-align: center;
border-radius: 6px;
padding: 50px 25px;
cursor: pointer;
transition: all 0.3s ease;
}
.services .serv-content .card:hover {
background: #ac5fdb;
}
.services .serv-content .card .box {
transition: all 0.3s ease;
}
.services .serv-content .card:hover .box {
transform: scale(1.05);
}
.services .serv-content .card i {
font-size: 50px;
color: #ac5fdb;
transition: color 0.3s ease;
}
.services .serv-content .card:hover i {
color: #fff;
}
.services .serv-content .card .text {
font-size: 25px;
font-weight: 500;
margin: 10px 0 7px 0;
}
/* contact section styling */
.contact .title::after {
content: "get in touch";
}
.contact .contact-content .column {
width: calc(50% - 30px);
}
.contact .contact-content .text {
font-size: 20px;
font-weight: 600;
margin-bottom: 10px;
}
.contact .contact-content .left p {
text-align: justify;
}
.contact .contact-content .left .icons {
margin: 10px 0;
}
.contact .contact-content .row {
display: flex;
height: 15px;
align-items: center;
}
.contact .contact-content .row .info {
margin-left: 30px;
background-color: #1e2029;
}
.contact .contact-content .row i {
font-size: 25px;
color: #ac5fdb;
}
.contact .contact-content .info .head {
font-weight: 500;
}
.contact .contact-content .info .sub-title {
color: #fff;
background-color: #1e2029;
}
.contact .right form .fields {
display: flex;
background-color: #1e2029;
}
.contact .right form .field,
.contact .right form .fields .field {
height: 45px;
width: 100%;
margin-bottom: 15px;
background-color: #1e2029;
}
.contact .right form .textarea {
height: 80px;
width: 100%;
background-color: #1e2029;
}
.contact .right form .name {
margin-right: 10px;
background-color: #1e2029;
}
.contact .right form .field input,
.contact .right form .textarea textarea {
height: 70%;
width: 100%;
border: 1px solid lightgrey;
border-radius: 6px;
outline: none;
padding: 0 15px;
font-size: 17px;
font-family: "Poppins", sans-serif;
transition: all 0.3s ease;
background-color: #1e2029;
}
.contact .right form .field input:focus,
.contact .right form .textarea textarea:focus {
border-color: #b3b3b3;
background-color: #1e2029;
}
.contact .right form .textarea textarea {
padding-top: 10px;
resize: none;
background-color: #1e2029;
}
.contact .right form .button-area {
display: flex;
align-items: center;
background-color: #1e2029;
}
.right form .button-area button {
color: #fff;
display: block;
width: 160px !important;
height: 45px;
outline: none;
font-size: 18px;
font-weight: 500;
border-radius: 6px;
cursor: pointer;
flex-wrap: nowrap;
background: #ac5fdb;
border: 2px solid #ac5fdb;
transition: all 0.3s ease;
}
.right form .button-area button:hover {
color: #ac5fdb;
background: none;
}
.fa-twitter,
.fa-github,
.fa-linkedin {
color: white;
}
.navbar-toggler-icon {
color: #ac5fdb;
}
.about,
.skills {
background-color: #1e2029;
}
#media (max-width: 991px) {
.services .max-width {
padding: 0;
}
.services .serv-content,
.services .serv-content .card {
width: 100%;
}
}
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="./style.css" />
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.11/typed.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<script src="https://kit.fontawesome.com/3263ba6030.js" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/3263ba6030.js" crossorigin="anonymous"></script>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>Edward Wynman</title>
<link rel="icon" type="image/x-icon" href="Files/PFP.jpg">
</head>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">Edward Wynman</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="true" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="courses.html">Courses</a>
</li>
<li class="nav-item">
<a class="nav-link" href="projects.html">Projects</a>
<li class="nav-item">
<a class="nav-link" href="/Files/Resume.pdf">Resume</a>
</li>
</ul>
</div>
</div>
</nav>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<body>
<section class="home">
<div class="jumbotron text-center">
<section class="home" id="home">
<div class="max-width">
<div class="home-content">
<div class="text-1">Hello, my name is</div>
<div class="text-2">Edward Wynman</div>
<div class="text-3">And I'm a <span class="typing">
<script>
$(document).ready(function () {
// typing text animation script
var typed = new Typed(".typing", {
strings: ["Student", "Developer", "Engineer"],
typeSpeed: 100,
backSpeed: 60,
loop: true
});
var typed = new Typed(".typing-2", {
strings: ["Student", "Developer", "Engineer"],
typeSpeed: 100,
backSpeed: 60,
loop: true
});
});
</script>
</span></div>
Email Me!
</div>
</div>
</section>
</section>
<section class="about" id="about">
<div class="max-width">
<h2 class="title">About me</h2>
<div class="about-content">
<div class="column-left" id="pic">
<img src="/Files/PFP.jpg" alt="">
</div>
<div class="column right">
<div class="text">I'm Eddie and I'm a <span class="typing-2"></span></div>
<p>At the age of <strong>thirteen</strong> I started programming and have taught myself a thing or two since then. Topics that interest me are <strong>web development,
UX Design , and Software Engineering </strong>Now, I'm a Computer Science student at
<strong> Montclair State University </strong>. I am currently seeking 2023 Summer internship opportunities in Software Engineering and Web Development. I am also pursuing a minor in <strong>Data Science</strong> This website showcases some
of <strong>my
abilities and skills.</strong>
</p>
Download Resume
Read More
</div>
</div>
</div>
</section>
<section class="skills" id="skills">
<div class="max-width">
<h2 class="title">My skills</h2>
<div class="skills-content">
<div class="column left">
<div class="text">My Skills</div>
<p>Over the years I have taken a lot from the classes I have taken and they have led me to a specfic set of skills. I am proficcient in Java, Python, C, JavaScript, HTML, CSS, PHP, Adobe Creative Suite Apps, and I am proficcient in MS Office products
as well.
</p>
Read more
</div>
<div class="column right">
<div class="bars">
<div class="info">
<span>Java</span>
<span>100%</span>
</div>
<div class="line html"></div>
</div>
<div class="bars">
<div class="info">
<span>Python</span>
<span>90%</span>
</div>
<div class="line css"></div>
</div>
<div class="bars">
<div class="info">
<span>JavaScript</span>
<span>80%</span>
</div>
<div class="line js"></div>
</div>
<div class="bars">
<div class="info">
<span>HTML | CSS </span>
<span>70%</span>
</div>
<div class="line php"></div>
</div>
<div class="bars">
<div class="info">
<span>PHP</span>
<span>50%</span>
</div>
<div class="line mysql"></div>
</div>
</div>
</div>
</div>
</section>
</div>
<footer class="content-footer">
<section class="footer-text">
<strong>Say hi to me on these social networks:</strong>
</section>
<ul class="social">
<i class="fab fa-twitter fa-2x mr-3"></i>
<i class="fab fa-github fa-2x mr-3"></i>
<a href="https://www.linkedin.com/in/edward-wynman/" target="_blank"><i
class="fab fa-linkedin fa-2x mr-3"></i></a>
</ul>
</footer>
</body>
You need to remove the width: 50%; on .about .about-content .right using a media query. The reason it's rendering like that is that it's using 50% of the available space on mobile, which is not much.
Could look something like this:
#media only screen and (max-width: 800px) {
.about .about-content .right {
width: 100%;
}
}
Here you go...
Add the following:
#media only screen and (max-width: 768px) {
.about .about-content .right {
width: 100% !important;
}
}
Hey in your codepen you made a mistake. The max-width needs to go from wider screens to smaller ones and not the oposite way, because, as the lower value in the page will always overwrite the further up ones, your media queries will never be met.
Put the max-width media queries at the end of the css or at least after the element you want to have a different style on smaller screens.
Then start with the highest number (max-width="1800px") and end with the lowest one (max-width="500px").
so:
//default (bigger than 993px)
.class {
font-size: 10px;
}
//992px and smaller
#media screen and (max-width:992px){
.class {
font-size: 20px;
}
}
//767px and smaller
#media screen and (max-width:767px){
.class {
font-size: 24px;
}
}
//600px and smaller
#media screen and (max-width:600px){
.class {
font-size: 32px;
}
}
Just like Cervus and Kameron have pointed out
.about .about-content .right {width: 100%}
is your main fix, then the next issue is the padding left and right on your max-width class because of
box-sizing: border-box
it will render 100% and then remove 80px of space on either side. If viewed on a small device it will be removing to much of the available space for example on 320px wide screen half the available space would be removed.
.max-width {padding: 0 80px}
Might be better being
.max-width {padding: 0 20px}
And then at a larger media query it can update to 80px when it fits.
Hello I am a beginner learning Html & CSS.
I was creating this website from my method and I ran into trouble.
I tried searching many solutions on stack overflow none of them seems to work,
or I don't understand how they work.
I have tried solutions from When using "height: 100vh" for the container, vertical scrollbar appears
but none of them seems to work.
So please if you mark this questions as duplicate, please comment and make me understand how to fix this error and then close it.
So when I assign 100vh to the bg-video class:
/* for laptop */
#media (min-width:1024px) {
.bg-video{
/* 100vh introduces scroll bar on both sides */
height: 100vh;
/* height 99vh fixes it but leaves a black empty line below */
/* height: 99vh; */
}
When the height is set to 100vh:
When the height is set to 99vh:
Full Html & CSS code (I know the code is long please refer to /* for laptop */ section in CSS ):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<!-- font awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- font awesome -->
<style>
*{
margin:0;
padding:0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
/* page */
body{
background-color: black;
}
/* page */
/* background section */
.background{
position: absolute;
}
.bg-video{
width: 100vw;
height: 320px;
object-fit: cover;
z-index: -1;
}
.overlay{
background-color: black;
width: 100vw;
height: 320px;
position:absolute;
opacity: 0.5;
}
/* background section */
/* header section */
.con-head{
position: relative;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
header{
padding: 20px 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo{
width: 130px;
}
.part1 a{
display: none;
}
.login{
display: none;
}
.part2 button{
display: none;
}
.menu{
width: 20px;
}
/* header section */
/* turbo section */
.turbo{
position: relative;
margin-left: auto;
margin-right: auto;
padding: 12px 20px;
color: white;
max-width: 1200px;
}
.turbo h1{
font-size: 2rem;
color: white;
line-height: 1em;
}
.turbo span{
color: rgb(20, 212, 212);
}
.turbo p{
padding: 10px 0;
font-size: 0.9rem;
}
.turbo button{
color: rgb(21, 4, 82);
text-decoration: none;
font-size: 1rem;
font-weight: bold;
letter-spacing: 1px;
background-color: white;
padding: 14px 20px;
border-radius: 20px;
border: none;
position: relative;
top: 20px;
/* gives width of 100 viewport*/
width: 100vw;
/* this makes width relative to its parent */
max-width: 100%;
}
.turbo button:hover{
background-color: rgb(20, 212, 212);
color: rgb(21, 4, 82);
}
/* turbo section */
/* for small screens */
#media (max-width:380px) {
.logo{
width: 30vw;
}
.part1 a{
display: none;
}
.part2 :nth-child(2){
display: none;
}
.part2 button{
display: none;
}
.menu{
width: 5vw;
}
.turbo h1{
font-size: 8vw;
}
.turbo p{
font-size: 4vw;
}
.turbo button{
font-size: 4vw;
}
.bg-video{
height: 54vh;
}
.overlay{
height: 54vh;
}
}
/* for small screens */
/* for laptop */
#media (min-width:1024px) {
.bg-video{
/* 100vh introduces Scroll bar on both sides */
/* height: 100vh; */
/* height 99vh fixes it but leaves a black empty line below */
height: 99vh;
}
.overlay{
height: 130px;
background: rgb(0,0,0);
background: linear-gradient(180deg, rgba(0,0,0,1) 43%, rgba(0,0,0,0.5606617647058824) 71%, rgba(0,0,0,0) 85%);
opacity: 0.6;
}
.logo{
width: 150px;
}
.menu{
display: none;
}
/* dont know why but this fixed the padding issue */
.con-head{
padding: 20px 20px;
}
header{
padding: 20px 0px;
}
.part1{
display: flex;
align-items: center;
}
.part1 a{
/* making them visible */
display: block;
color: white;
text-decoration: none;
padding: 0 20px;
font-weight:500;
letter-spacing: 1px;
}
.part1 a:hover{
text-decoration: underline;
}
.part1 :nth-child(2){
margin-left: 20px;
}
.part2{
display: flex;
align-items: center;
}
.login{
display: block;
color: white;
text-decoration: none;
font-weight: 500;
letter-spacing: 1px;
padding:0 20px;
}
.login:hover{
text-decoration: underline;
}
.part2 button{
display: block;
color: white;
text-decoration: none;
font-weight: bold;
letter-spacing: 1px;
padding:10px 20px;
background-color: rgb(20, 212, 212);
border: none;
border-radius: 999px;
}
.part2 button:hover{
color: rgb(21, 4, 82);
background-color: white;
}
.turbo{
position: relative;
top: 50px;
}
.turbo h1{
font-size: 3rem;
}
.turbo p{
font-size: 1em;
margin-top: 15px;
}
.turbo button{
width: 200px;
border-radius: 999px;
margin-top: 20px;
}
}
/* for laptop */
</style>
<title>Chris Courses</title>
</head>
<body>
<div class="page">
<!-- background video -->
<section class="background">
<div class="overlay"></div>
<video src="https://chriscourses.com/_nuxt/videos/galaxy.b6c8fb5.mp4"
autoplay
muted
loop
class="bg-video"
>
</video>
</section>
<!-- head -->
<section class="con-head">
<header>
<!-- p1 -->
<div class="part1">
<img src="logo.svg" alt="" class="logo">
<!-- laptop screen -->
Courses
Forum
Pricing
<!-- laptop screen -->
</div>
<!-- p2 -->
<div class="part2">
<a href="">
<img src="menu.svg" alt="" class="menu">
</a>
LOGIN
<button>SIGN UP</button>
</div>
</header>
</section>
<!-- turbo charge section -->
<div class="turbo">
<h1>Turbocharge your<br>
<span>development career</span>
</h1>
<p>
Chris Courses provides students and professionals <br>
a college-level web development education.
</p>
<button>Get started</button>
</div>
</div>
</body>
</html>
You simply need to add display: block; to the .bg-video and it fixes the issue
* {
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
/* page */
body {
background-color: black;
}
/* page */
/* background section */
.background {
position: absolute;
}
.bg-video {
display: block;
width: 100vw;
height: 320px;
object-fit: cover;
z-index: -1;
}
.overlay {
background-color: black;
width: 100vw;
height: 320px;
position: absolute;
opacity: 0.5;
}
/* background section */
/* header section */
.con-head {
position: relative;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
header {
padding: 20px 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
width: 130px;
}
.part1 a {
display: none;
}
.login {
display: none;
}
.part2 button {
display: none;
}
.menu {
width: 20px;
}
/* header section */
/* turbo section */
.turbo {
position: relative;
margin-left: auto;
margin-right: auto;
padding: 12px 20px;
color: white;
max-width: 1200px;
}
.turbo h1 {
font-size: 2rem;
color: white;
line-height: 1em;
}
.turbo span {
color: rgb(20, 212, 212);
}
.turbo p {
padding: 10px 0;
font-size: 0.9rem;
}
.turbo button {
color: rgb(21, 4, 82);
text-decoration: none;
font-size: 1rem;
font-weight: bold;
letter-spacing: 1px;
background-color: white;
padding: 14px 20px;
border-radius: 20px;
border: none;
position: relative;
top: 20px;
/* gives width of 100 viewport*/
width: 100vw;
/* this makes width relative to its parent */
max-width: 100%;
}
.turbo button:hover {
background-color: rgb(20, 212, 212);
color: rgb(21, 4, 82);
}
/* turbo section */
/* for small screens */
#media (max-width:380px) {
.logo {
width: 30vw;
}
.part1 a {
display: none;
}
.part2 :nth-child(2) {
display: none;
}
.part2 button {
display: none;
}
.menu {
width: 5vw;
}
.turbo h1 {
font-size: 8vw;
}
.turbo p {
font-size: 4vw;
}
.turbo button {
font-size: 4vw;
}
.bg-video {
height: 54vh;
}
.overlay {
height: 54vh;
}
}
/* for small screens */
/* for laptop */
#media (min-width:1024px) {
.bg-video {
height: 100vh;
}
.overlay {
height: 130px;
background: rgb(0, 0, 0);
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 43%, rgba(0, 0, 0, 0.5606617647058824) 71%, rgba(0, 0, 0, 0) 85%);
opacity: 0.6;
}
.logo {
width: 150px;
}
.menu {
display: none;
}
/* dont know why but this fixed the padding issue */
.con-head {
padding: 20px 20px;
}
header {
padding: 20px 0px;
}
.part1 {
display: flex;
align-items: center;
}
.part1 a {
/* making them visible */
display: block;
color: white;
text-decoration: none;
padding: 0 20px;
font-weight: 500;
letter-spacing: 1px;
}
.part1 a:hover {
text-decoration: underline;
}
.part1 :nth-child(2) {
margin-left: 20px;
}
.part2 {
display: flex;
align-items: center;
}
.login {
display: block;
color: white;
text-decoration: none;
font-weight: 500;
letter-spacing: 1px;
padding: 0 20px;
}
.login:hover {
text-decoration: underline;
}
.part2 button {
display: block;
color: white;
text-decoration: none;
font-weight: bold;
letter-spacing: 1px;
padding: 10px 20px;
background-color: rgb(20, 212, 212);
border: none;
border-radius: 999px;
}
.part2 button:hover {
color: rgb(21, 4, 82);
background-color: white;
}
.turbo {
position: relative;
top: 50px;
}
.turbo h1 {
font-size: 3rem;
}
.turbo p {
font-size: 1em;
margin-top: 15px;
}
.turbo button {
width: 200px;
border-radius: 999px;
margin-top: 20px;
}
}
/* for laptop */
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<div class="page">
<!-- background video -->
<section class="background">
<div class="overlay"></div>
<video src="https://chriscourses.com/_nuxt/videos/galaxy.b6c8fb5.mp4" autoplay muted loop class="bg-video">
</video>
</section>
<!-- head -->
<section class="con-head">
<header>
<!-- p1 -->
<div class="part1">
<img src="logo.svg" alt="" class="logo">
<!-- laptop screen -->
Courses
Forum
Pricing
<!-- laptop screen -->
</div>
<!-- p2 -->
<div class="part2">
<a href="">
<img src="menu.svg" alt="" class="menu">
</a>
LOGIN
<button>SIGN UP</button>
</div>
</header>
</section>
<!-- turbo charge section -->
<div class="turbo">
<h1>Turbocharge your<br>
<span>development career</span>
</h1>
<p>
Chris Courses provides students and professionals <br> a college-level web development education.
</p>
<button>Get started</button>
</div>
</div>
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.
First problem is the "about myself" (home_about_box), doing something that will not allow me to put it on top of an image. I think it has something to do with the margin, but I have not found a solution.
Second problem is that the images in the Portfolio section (portfolio_home), will not touch each other, it leaves a blank space between the pictures.
Last problem is with having a horizontal scrollbar on the bottom of my page. I have searched for a solution, but not found any.
If you have any solution, I would appreciate you posting the code and an explanation, as I am quite new to this!
Cheers! Any constructive feedback is well appreciated!
HTML
<section class="home.about">
<div class="about.bg">
<div class="home_about_box">
<h1>About Myself</h1>
<p>Lorem ipsum...</p>
<p>Lorem ipsum...</p>
</div>
</div>
</section>
<section class="portfolio_home" id="portfolio">
<h1>Some of my work</h1>
<figure class="port-item">
<!-- Portfolio 1 -->
<img src="https://i.imgur.com/eBRYWII.png" alt="portfolio item"/>
<figcaption class="port-desc">
<p>Geofilters</p>
</figcaption>
</figure>
<!-- Portfolio 2 -->
<figure class="port-item">
<img src="https://i.imgur.com/gAfgliA.png" alt="portfolio item"/>
<figcaption class="port-desc">
<p>Quixz eSports</p>
</figcaption>
</figure>
<!-- Portfolio 3 -->
<figure class="port-item">
<img src="https://i.imgur.com/IjoGmUT.png" alt="portfolio item"/>
<figcaption class="port-desc">
<p>3D Renders</p>
</figcaption>
</figure>
<!-- Portfolio 4 -->
<figure class="port-item">
<img src="https://i.imgur.com/4zymXa8.png" alt="portfolio item"/>
<figcaption class="port-desc">
<p>Backgrounds</p>
</figcaption>
</figure>
</section>
<section class="cta">
<div class="container">
<h1 class="title title-cta">Want to see more?
<span>Then what are you waiting for?</span>
</h1>
See More
</div>
</section>
CSS
* {
box-sizing: border-box;
transition: all ease-in-out 250ms;
}
body {
margin: 0;
font-family: "Lato", sans-serif;
text-align: center;
}
img {
max-width: 100%;
height: auto;
padding: 1em .5em 0;
background-size: cover;
}
.container {
width: calc(100%-4px);
margin: 0 auto;
}
/* Header
========= */
header {
position: absolute;
width: 100%;
}
nav ul {
margin: 0;
padding: 1em 0;
list-style: none;
}
nav li {
display: inline-block;
margin: .5em
}
nav a {
font-weight: 900;
text-decoration: none;
text-transform: uppercase;
font-size: .9rem;
padding: .5em;
color: #FFF;
}
nav a:hover,
nav a:focus{
color: #DDD;
}
#media (min-width: 60rem) {
.logo{
float: left;
text-align: center;
align-content: center;
}
nav{
float: right;
text-align: center;
margin-right: 1em;
}
}
/* Buttons
========== */
.button_top {
display: inline-block;
font-size: 1.3rem;
text-decoration: none;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
border-color: #174FC1;
padding: .5em 1em;
color: #FFF;
}
.button_top:hover,
.button_top:focus {
background: #174FC1;
color: #FFF;
}
.button_dark {
display: inline-block;
font-size: 1.3rem;
text-decoration: none;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
border-color: #FFF;
padding: .5em 1em;
color: #FFF;
margin-bottom: 1em;
}
.button_dark:hover,
.button_dark:focus {
background: #FFF;
color: #000;
}
#media (min-width: 25rem) {
.button_top {
font-size: 1.7rem;
padding: .3em 1em
}
}
#media (min-width: 60rem) {
.button_top {
font-size: 2.4rem;
padding: .3em 1em;
margin-top: -1em;
}
}
#media (min-width: 25rem) {
.button_dark {
font-size: 1.7rem;
padding: .3em 1em
}
}
#media (min-width: 60rem) {
.button_dark {
font-size: 2rem;
padding: .3em 1em;
}
}
.clearfix::after,
section::after,
footer::after{
content: "";
display: block;
clear: both;
}
/* Typography
========= */
.title {
font-size: 2rem;
margin-bottom: 1.6em;
margin-top: 5em;
}
.title span {
font-weight: 300;
display: block;
font-size: 1.3rem;
}
.title-cta {
margin: 0 0 1em;
}
#media (min-width: 60rem) {
.title{
font-size: 4rem;
margin-top: 1.5em;
}
}
h1 {
font-weight: 800;
margin-top: 0;
}
.unstyled-list {
margin: 0;
padding: 1.3em;
list-style-type: none;
text-align: left;
}
/* Home.hero
========= */
.home-hero {
background-image: url(https://i.imgur.com/yUFKqAe.jpg);
background-size: cover;
background-position: center;
padding: 1em;
color: #FFF;
width: 100vw;
height: 100vh;
}
#media (min-width: 25rem) {
.home-hero{
width: 100vw;
height: 100vh;
}
}
#media (min-width: 60rem) {
.home-hero{
width: 100vw;
height: auto;
}
}
#media (min-height: 30rem) {
.home-hero{
width: 100vw;
height: 100vh;
}
}
/*Home About */
.home_about_box {
background-color: #232323;
font-size: .8em;
padding: 4em;
outline: 2px solid #174fc1;
outline-offset: -3em;
color: #FFF;
position: relative
}
.home_about_box h1 {
color: #174fc1;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 1.3em;
background: #232323;
padding: 0 0.5em
}
#media (min-width: 25rem) {
h1 {
font-size: 1.6rem;
}
.home_about_box h1 {
top: 1.3rem;
}
}
#media (min-width: 60rem) {
h1 {
font-size: 1.2rem;
}
.about.bg {
background-image: url(https://i.imgur.com/aTF2hwR.jpg);
padding: 5em;
}
.home_about_box {
font-size: .8em;
width: 25em;
margin: 0;
}
.home_about_box h1 {
top: 1.5rem;
}
}
/* portfolio
*/
.portfolio_home {
margin: 1.8em 0 0;
background-size: cover;
}
.portfolio_home h1 {
color: #174FC1;
font-size: 3em;
margin: auto;
padding: 0 0 .3em 0;
}
.port-item {
margin: 0;
position: relative;
}
.port-item img {
display: block;
}
.port-desc {
position: absolute;
z-index: 100;
bottom: 0em;
left: 0em;
right: 0em;
color: #FFF;
background: rgba(0,0,0,.75);
padding-bottom: 1em;
padding-top: 1em;
}
.port-desc p {
margin: .5em;
background-size: 100% 100%;
}
#media (min-width: 40rem) {
.port-item {
width: 50%;
float: left;
}
}
#media (min-width: 60rem) {
.port-item {
width: 33.3333334%;
float: left;
overflow: hidden
}
.port-desc {
transform: translateY(150%);
}
.port-item:hover .port-desc {
transform: translateY(0%)
}
}
/* CTA
*/
.cta{
background-color: #174fc1;
padding: 0.1em;
}
.cta h1 {
margin-top: 1em;
color: #FFF
}
/* Footer */
footer {
background: #232323;
color: #FFF;
}
Firstly you need to minimize the codepen like the this you don't need everything in it.
First Problem:-
For the first issue make sure your z-index is greater than the element overlapping it in your case it's .port-desc giving a z-index of 100 so you need something more than 100.
.home_about_box {
background-color: #232323;
font-size: 0.8em;
padding: 4em;
outline: 2px solid #174fc1;
outline-offset: -3em;
color: #fff;
z-index: 101;
}
Second Problem:-
You need to remove the padding on left and right I assume that's what you meant when you say they are not touching.
img {
max-width: 100%;
height: auto;
padding: 1em 0.5em 0;
background-size: cover;
}
Third Problem:-
The scrollbar is due to width being 100wh, you can update the width to be 100%.
#media (min-height: 30rem) {
.home-hero {
width: 100%;
height: 100vh;
}
}
Please could somebody help me with flex for pushing my footer down / expanding the content to fit?
https://jsfiddle.net/9xjy78gj/
Hopefully it's clear to see from the site what my issue is.
I'd just like to use flex to push the footer down and expand the content div appropriately, without using set heights for the content div etc. if possible?
Many thanks!
HTML
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="page_wrap">
<header>
<a href="/">
<h1>Close<span><i class="fa fa-map-marker" aria-hidden="true"></i></span>Range</h1>
</a>
<hr />
</header>
<div id="refinement">
<form>
<div class="form_component">
<select id="narrow">
<option value="select" selected disabled>Please Select</option>
</select>
</div>
<div class="form_component">
<input id="driving" type="radio" name="travelmode" value="Driving" checked /> <i class="fa fa-car" aria-hidden="true"></i>
</div>
<div class="form_component">
<input id="walking" type="radio" name="travelmode" value="Walking" /> <i class="fa fa-male" aria-hidden="true"></i>
</div>
</form>
</div>
<div id="jquery_placeholder">
<!-- JQuery loads PHP output into here-->
</div>
<div id="place_results_wrap">
<!-- and here -->
<div id="content">
<h2>Let's explore!</h2>
<i class="fa fa-globe" aria-hidden="true"></i>
</div>
</div>
<footer class="footer">
<div id="google">
<img src="/assets/i/google.png" alt="Powered by Google" />
</div>
</footer>
</div>
</body>
</html>
CSS
a, a:hover
{
text-decoration: none;
}
body
{
font-family: 'Open Sans', sans-serif;
background: #ECECEA;
font-size:16px;
}
#page_wrap
{
width:100%;
}
header
{
background: #fff;
text-align: center;
padding: 1.250em;
}
header h1
{
font-size: 6em;
font-weight: 400;
color: #655e5e;
margin: 0;
display: inline-block;
}
#media screen and (max-width: 550px)
{
header h1 {
font-size: 3em;
}
}
header hr
{
max-width: 36em;
margin-bottom: 0px;
}
header .fa-map-marker
{
color: #ec3b3b;
font-size: 1.2em;
}
#refinement
{
padding: 0.5em 1.25em 1.25em;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
#refinement form
{
display: flex;
justify-content: center;
}
.form_component
{
margin: 0 0.4em;
display: none;
}
.form_component i.fa
{
font-size: 1.4em;
color: #655e5e;
}
#content
{
text-align: center;
background: #655e5e;
padding: 1.25em;
}
#content h2
{
color: #fff;
font-weight: 400;
font-size: 4em;
margin: 0;
}
#media screen and (max-width: 415px) {
#content h2
{
font-size:2em;
}
}
#content i.fa-globe
{
font-size: 18em;
color: #fff;
}
.place_results
{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
padding: 1.25em 0;
}
.next_page
{
padding: 0 1.250em;
width: 100%;
text-align: center;
}
.next_page button
{
background-color: #fff;
border: none;
color: #655e5e;
padding: 0.3125em 2em;
text-decoration: none;
display: inline-block;
font-size: 1em;
font-weight: 600;
cursor: pointer;
border-radius: 1.25em;
}
.next_page button:hover
{
background-color: #f6f6f6;
}
.place
{
width: 24em;
height: 27em;
margin: 1.25em;
display: flex;
flex-direction: column;
-webkit-box-shadow: 5px 6px 20px 0px rgba(158,155,158,0.75);
-moz-box-shadow: 5px 6px 20px 0px rgba(158,155,158,0.75);
box-shadow: 5px 6px 20px 0px rgba(158,155,158,0.75);
background: #fff;
}
#media screen and (max-width: 1920px) {
.place
{
width: 30%;
}
}
#media screen and (min-width: 900px)
and (max-width: 1366px){
.place
{
width: 45%;
}
}
#media screen and (min-width: 768px)
and (max-width: 1366px){
.place
{
width: 44%;
}
}
#media screen and (min-width: 415px)
and (max-width: 760px){
.place
{
width: 90%;
}
}
#media screen and (max-width: 415px) {
.place
{
width: 90%;
}
}
.place_image
{
width: 100%;
height: 14.0625em;
background-size: cover !important;
background-clip: content-box !important;
}
.place_description
{
padding: 0.625em;
display: flex;
flex-direction: column;
flex: 1 1 0;
background: #fff;
}
.distance_container p.distance
{
font-weight:600;
}
.place_description p, .place_description a
{
color: #655e5e;
font-weight: 400;
margin: 0;
}
.place_description .place_open p
{
margin: 0;
color: #49b51c;
}
.place_description i.fa
{
width: 1.25em;
}
.place_title
{
flex: 1 1 0;
}
.place_title h3
{
color: #655e5e;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
margin: 0;
font-size: 1.4em;
line-height: 1.3;
}
#media screen and (max-width: 415px) {
.place_title h3
{
font-size: 1.2em;
}
}
.rating_container
{
width: 100%;
}
.rating_bar {
width: 6.875em;
height: 1.313em;
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/2605/star-rating-sprite.png);
background-repeat: repeat-x;
background-position: 0 0;
}
.rating {
height: 1.313em;
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/2605/star-rating-sprite.png);
background-position: 0 100%;
background-repeat: repeat-x;
}
.place_description .place_location
{
margin-bottom: 0.625em;
}
.place .distance_container, .place .vicinity_container, .place .place_phone_container
{
display: flex;
}
#load_container
{
padding: 1.25em;
text-align: center;
}
#load i.fa-spin
{
font-size: 4em;
color: #ec3b3b;
}
#jquery_placeholder
{
display:none;
width:100%;
}
footer
{
padding: 1.25em;
text-align: right;
background: #fff;
}
footer #google img
{
width: 10em;
}
#error
{
padding: 1.25em;
background: #ec3b3b;
}
#error p
{
font-size: 1.2em;
margin: 0;
color: #fff;
text-align: center;
}
#error i.fa-exclamation-circle
{
color: #fff;
}
Flexbox can do that providing you use flex-direction:column like so:
If you don't want sections to expand to take up spare space, just remove the flex:1.
html,
body {
height: 100%;
}
body {
min-height: 100%;
text-align: center;
/* for demo */
}
.page-wrap {
min-height: 100%;
display: flex;
flex-direction: column;
}
header {
background: pink;
}
footer {
background: rebeccapurple;
color: #fff;
}
aside {
flex: 1;
background: orange;
}
main {
flex: 1;
background: grey;
}
<div class="page-wrap">
<header>
<h1>Header</h1>
</header>
<aside>I'm a secondary header</aside>
<main>I'm main content</main>
<footer>
<h1>Footer</h1>
</footer>
</div>