large grid css no picture displaying - css

I have a webpage where the css for the small and medium size work and display fine. my problem is with the large, everything is formatted correctly except that the page picture won't display. How do I fix this? Attached is the page layout and the full css. The error should be under the #media(min-width: 1024px)
header {
background-color: #002171;
color: #FFFFFF;
background-position: right;
background-repeat: no-repeat;
}
header a:link {
color: #FFFFFF;
text-decoration-line: none;
}
header a:visited {
color: #FFFFFF;
text-decoration-line: none;
}
header a:hover {
color: #90C7E3;
}
h1 {
margin-top: 0;
margin-bottom: 0;
text-align: center;
font-family: Georgia, serif;
letter-spacing: 0.25em;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
* {
box-sizing: border-box;
}
nav {
font-weight: bold;
font-size: 120%;
padding: 0;
text-align: center;
}
nav li {
border-bottom: none;
}
nav a {
text-decoration: none;
}
section {
padding-left: 2em;
padding-right: 2em;
}
h2 {
color: #1976D2;
font-family: Georgia, serif;
text-shadow: 1px 1px 1px #CCCCCC;
}
h3 {
color: #000033;
font-family: Georgia, serif;
}
#media(min-width: 600px) {
nav ul {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
justify-content: space-around;
}
.content main {
display: grid;
grid-template-rows: auto;
grid-template-columns: 1fr 1fr 1fr;
}
h2 {
grid-row: 1 / 2;
grid-column: 1 / 5;
}
section {
grid-row: 2 / 3;
grid-column: auto;
}
#special {
grid-row: auto;
grid-column: 1 / 5;
}
footer {
grid-row: auto;
grid-column: 1 / 5;
}
}
#media(min-width: 1024px) {
nav ul {
flex-direction: column;
padding-top: 1em;
}
nav {
text-align: left;
padding-left: 1em;
padding-right: 1em;
grid-row: 2/3;
grid-column: 1/2;
}
main {
grid-row: 2/3;
grid-column: 2/3;
}
footer {
grid-row: 3/4;
grid-column: 2/4;
}
header {
grid-row: 1/2;
grid-column: 1/4;
}
#wrapper {
margin: auto;
width: 80%;
border: #00008B;
box-shadow: 1px 1px 1px;
display: grid;
grid-row: 3/3;
grid-column: 2/2;
}
}
}
main ul {
list-style-image: url('marker.gif');
font-family: Georgia, serif;
}
nav ul {
list-style: none;
margin: 0;
padding-left: 0;
font-size: 1.2em;
}
nav a:link {
color: #5C7FA3;
}
nav a:visited {
color: #344873;
}
nav a:hover {
color: #A52A2A;
}
body {
font-family: Helvetica;
background-color: #EAEAEA;
color: #666666;
}
main {
background-color: #FFFFFF;
padding-top: 1px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 30px;
overflow: auto;
display: block;
}
dt {
color: #002171;
}
#wrapper {
background-color: #90C7E3;
background-image: linear-gradient(#FFFFFF, #90C7E3);
}
#homehero {
background-image: url('coast2.jpg');
height: 300px;
background-size: 100% 100%;
background-repeat: no-repeat;
}
#yurthero {
background-image: url('yurt.jpg');
height: 300px;
background-size: 100% 100%;
background-repeat: no-repeat;
}
#trailhero {
background-image: url('trail.jpg');
height: 300px;
background-size: 100% 100%;
background-repeat: no-repeat;
}
.resort {
font-weight: bold;
color: #1976D2;
}
footer {
background-color: #FFFFFF;
font-family: Georgia, serif;
font-size: 75%;
font-style: italic;
text-align: center;
padding: 2em;
}
#contact {
font-size: 90%;
}
<div id="wrapper">
<header>
<h1>Pacific Trails Resort</h1>
</header>
<nav>
<ul>
<li>Home</li>
<li>Yurts</li>
<li>Activities</li>
<li>Reservations</li>
</ul>
</nav>
<div id="homehero">
</div>
<main>
<h2>Enjoy Nature in Luxury</h2>
<p><span class="resort">Pacific Trails Resort</span> offers a special lodging experience on the California North Coast with panoramic views of the Pacific Ocean. Your stay at Pacific Trails Resort includes a sumptuously appointed private yurt and a cooked-to-order
breakfast each morning.</p>
<ul>
<li>Unwind in the heated outdoor pool and whirlpool</li>
<li>Explore the coast on your own or join our guided tours</li>
<li>Relax in our lodge while enjoying complimentary appetizers and beverages</li>
<li>Savor nightly fine dining with an ocean view</li>
</ul>
<div id="contact">
<span class="resort">Pacific Trails Resort</span><br> 12010 Pacific Trails Road <br> Zephyr, CA 95555<br>
<br> 888-555-5555
<br>
</div>
</main>
<footer>
Copyright © 2020 Pacific Trails Resort<br>
freed.nm#rhodesstate.edu
</footer>
</div>

From what I understand your image does not appear when the screen size is greater than 1024px. I made some changes to the code and got it to work as you wish, I think ...
I hope that's what you want
<!DOCTYPE html>
<html lang="en">
<head>
<title>Pacific Trails Resort</title>
<!-- <link rel="stylesheet" href="pacific.css"> -->
<meta charset="utf-8">
<style>
header {
background-color: #002171;
color: #FFFFFF;
background-position: right;
background-repeat: no-repeat;
}
header a:link {
color: #FFFFFF;
text-decoration-line: none;
}
header a:visited {
color: #FFFFFF;
text-decoration-line: none;
}
header a:hover {
color: #90C7E3;
}
h1 {
margin-top: 0;
margin-bottom: 0;
text-align: center;
font-family: Georgia, serif;
letter-spacing: 0.25em;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
* {
box-sizing: border-box;
}
nav {
font-weight: bold;
font-size: 120%;
padding: 0;
text-align: center;
}
nav li {
border-bottom: none;
}
nav a {
text-decoration: none;
}
section {
padding-left: 2em;
padding-right: 2em;
}
h2 {
color: #1976D2;
font-family: Georgia, serif;
text-shadow: 1px 1px 1px #CCCCCC;
}
h3 {
color: #000033;
font-family: Georgia, serif;
}
#media(min-width: 600px) {
nav ul {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
justify-content: space-around;
}
.content main {
display: grid;
grid-template-rows: auto;
grid-template-columns: 1fr 1fr 1fr;
}
h2 {
grid-row: 1 / 2;
grid-column: 1 / 5;
}
section {
grid-row: 2 / 3;
grid-column: auto;
}
#special {
grid-row: auto;
grid-column: 1 / 5;
}
footer {
grid-row: auto;
grid-column: 1 / 5;
}
}
#media(min-width: 1024px) {
nav ul {
flex-direction: column;
padding-top: 1em;
}
nav {
text-align: left;
padding-left: 1em;
padding-right: 1em;
grid-row: 2/3;
grid-column: 1/2;
}
main {
grid-row: 2/3;
grid-column: 2/3;
}
footer {
grid-row: 3/4;
grid-column: 2/4;
}
header {
grid-row: 1/2;
grid-column: 1/4;
}
#wrapper {
margin: auto;
width: 80%;
border: #00008B;
box-shadow: 1px 1px 1px;
display: grid;
grid-row: 3/3;
grid-column: 2/2;
}
}
}
main ul {
list-style-image: url('marker.gif');
font-family: Georgia, serif;
}
nav ul {
list-style: none;
margin: 0;
padding-left: 0;
font-size: 1.2em;
}
nav a:link {
color: #5C7FA3;
}
nav a:visited {
color: #344873;
}
nav a:hover {
color: #A52A2A;
}
body {
font-family: Helvetica;
background-color: #EAEAEA;
color: #666666;
}
main {
background-color: #90C7E3;
padding-top: 1px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 30px;
overflow: auto;
display: block;
}
dt {
color: #002171;
}
#wrapper {
background-color: #90C7E3;
background-image: linear-gradient(#FFFFFF, #90C7E3);
}
#homehero {
height: 300px;
background-size: 100% 100%;
background-repeat: no-repeat;
}
#yurthero {
background-image: url('yurt.jpg');
height: 300px;
background-size: 100% 100%;
background-repeat: no-repeat;
}
#trailhero {
background-image: url('trail.jpg');
height: 300px;
background-size: 100% 100%;
background-repeat: no-repeat;
}
.resort {
font-weight: bold;
color: #1976D2;
}
footer {
background-color: #EAEAEA;
font-family: Georgia, serif;
width: 100%;
font-size: 75%;
font-style: italic;
text-align: center;
padding: 22px;
}
#contact {
font-size: 90%;
}
.details {
padding: 20px;
}
</style>
</head>
<body>
<div id="wrapper">
<header>
<h1>Pacific Trails Resort</h1>
</header>
<nav>
<ul>
<li>Home</li>
<li>Yurts</li>
<li>Activities</li>
<li>Reservations</li>
</ul>
</nav>
<div id="homehero">
<img src="coast2.jpg" alt="Coast2 Image">
</div>
<hr>
<div class="wrap">
<main>
<h2>Enjoy Nature in Luxury</h2>
<p><span class="resort">Pacific Trails Resort</span> offers a special lodging experience on the
California
North Coast with panoramic views of the Pacific Ocean. Your stay at Pacific Trails Resort includes a
sumptuously appointed private yurt and a cooked-to-order breakfast each morning.</p>
<ul>
<li>Unwind in the heated outdoor pool and whirlpool</li>
<li>Explore the coast on your own or join our guided tours</li>
<li>Relax in our lodge while enjoying complimentary appetizers and beverages</li>
<li>Savor nightly fine dining with an ocean view</li>
</ul>
<div id="contact">
<span class="resort">Pacific Trails Resort</span><br>
12010 Pacific Trails Road <br>
Zephyr, CA 95555<br>
<br>
888-555-5555<br>
</div>
</main>
</div>
<!-- <footer>
Copyright © 2020 Pacific Trails Resort<br>
freed.nm#rhodesstate.edu
</footer> -->
<div class="details">
<h2>Details</h2>
<ul>
<li>Dedicated</li>
<li>Fast</li>
<li>Secure</li>
</ul>
<br><br>
<h2>Social Networks</h2>
<ul>
<li>Facebook</li>
<li>Instagram</li>
<li>Twitter</li>
</ul>
<br><br>
<h2>Details</h2>
<ul>
<li>Dedicated</li>
<li>Fast</li>
<li>Secure</li>
</ul>
<br><br>
<h2>Social Networks</h2>
<ul>
<li>Facebook</li>
<li>Instagram</li>
<li>Twitter</li>
</ul>
<br><br>
</div>
</div>
<br><br>
<footer>
Copyright © 2020 Pacific Trails Resort<br>
freed.nm#rhodesstate.edu
</footer>
</body>
</html>
Please leave any comments if any problems arise, I would like to help

Related

A flexbox property ignored on media query

I followed a YouTube video called "The 2020 HTML & CSS Crash Course - From Mockup to Product", everything is fine and works as it should, except in one thing (which I will explain), however the problem doesn't seem to happen on the teachers website, even though the code is exactly the same.
So, the problem is that in one of the media queries (650px), the .companies selector takes on display: flex, but it completely ignores the justify-content property and it breaks out of the container and off the screen, and this happens on my laptop, desktop, and I tried on my girlfriends macbook: same thing in all. It doesn't seem to happen in his, it works as it should as far as I can see. Anyway, I'll put the code below and also here's the link to the teachers codepen: https://codepen.io/designcourse/pen/bGdQGgQ
Which I should mention, still has the problem on my computers, it's only on his videos where it doesn't happen (that I can see).
Thanks in advance, this is driving me mad.
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/main.css">
<title>Document</title>
</head>
<body>
<div class="hero-wrapper">
<div class="wrapper">
<header>
WebDeveloper
<nav>
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
</header>
<div class="hero-content">
<h1>I help millions of people learn stuff</h1>
<p class="subtitle">Teaching UI / UX & Frontend Development</p>
</div>
</div>
</div>
<div class="light-purple-wrapper">
<div class="wrapper">
<ul class="stats">
<li>
<strong>26.5M</strong>
<span>Youtube Views</span>
</li>
<li>
<strong>535K</strong>
<span>YouTube Subs</span>
</li>
<li>
<strong>86</strong>
<span>Courses</span>
</li>
<li>
<strong>750</strong>
<span>Video Tutorials</span>
</li>
<li>
<strong>58</strong>
<span>Countries</span>
</li>
</ul>
</div>
<div class="extended-wrapper carousel-container">
<img src="images/arrow_copy_copy.svg" id="left-arrow" class="arrows" alt="">
<ul class="carousel">
<li>
<blockquote>"Gary is a life saver. I don't have the time or money for a college education. My goal is to
become a freelance web developer, and thanks to Gary, I'm really close."</blockquote>
<cite>John Doe</cite>
</li>
<li>
<blockquote>"Gary is a life saver. I don't have the time or money for a college education. My goal is to
become a freelance web developer, and thanks to Gary, I'm really close."</blockquote>
<cite>John Doe</cite>
</li>
</ul>
<img src="images/arrow_copy_copy.svg" id="right-arrow" class="arrows right" alt="">
</div>
</div>
<div class="wrapper move-up v-padding">
<h2>Companies I've worked with.</h2>
<ul class="companies">
<li><img src="images/skillshare.svg" alt="skillshare" class="skillshare"></li>
<li><img src="images/ps.svg" alt="plural sight" class="ps"></li>
<li><img src="images/skillshare.svg" alt="skillshare" class="skillshare"></li>
<li><img src="images/ps.svg" alt="plural sight" class="ps"></li>
</ul>
</div>
</body>
</html>
////// SCSS ///////
#import url('https://fonts.googleapis.com/css?family=Montserrat:300,800&display=swap');
* {
box-sizing: border-box;
}
body {
margin: 0;
background: #2B192F;
color: #fff;
font-family: 'Montserrat';
}
a {
color: #fff;
text-decoration: none;
}
ul {
list-style: none;
margin: 0;
padding: 0;
}
.hero-wrapper {
background: url('../images/bg_copy.jpg');
background-size: cover;
}
.wrapper {
padding: 1.5em;
max-width: 1200px;
margin: 0 auto;
}
header {
display: flex;
justify-content: space-between;
.logo {
font-weight: bold;
}
ul {
display: flex;
li a {
padding: 0 .6em;
}
}
}
.hero-content {
margin: 4em 0 2em;
.subtitle {
margin-bottom: 0;
}
}
.light-purple-wrapper {
background: #351F3A;
}
.stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
justify-content: space-around;
margin-top: 2em;
li {
margin-bottom: 1.5em;
}
strong {
font-size: 1.4em;
}
span {
display: block;
text-transform: uppercase;
font-size: .7em;
}
}
.arrows {
display: none;;
}
.extended-wrapper {
padding: 0 1.5em 2em;
max-width: 1230px;
margin: 0 auto;
}
ul.carousel {
margin-bottom: 1em;
li {
background: #422847;
padding: 1em;
margin-bottom: 1em;
}
}
blockquote {
margin: 0;
font-size: .8em;
line-height: 1.8em;
margin-bottom: 1em;
}
cite {
color:#E379FF;
font-weight: bold;
font-size: .8em;
font-style: normal;
position: relative;
padding-left: 25px;
}
cite::before {
content: " ";
position: absolute;
left: 0;
top: 6px;
height: 1px;
width: 20px;
border-bottom: 1px solid #fff;
}
h2 {
text-align: center;
position: relative;
}
h2::before {
content: "";
position: absolute;
height: 5px;
width: 30px;
background: #B728DC;
top: -.3em;
}
.companies {
text-align: center;
opacity: .4;
li {
margin: 2em 0;
}
.skillshare {
width: 100px;
}
.ps {
width: 200px;
}
}
#media (min-width: 500px) {
.companies {
display: grid;
grid-template-columns: repeat(2, auto);
}
}
#media (min-width: 650px) {
body {
font-size: 18px;
}
.wrapper {
padding: 1.5em 4em;
}
.carousel-container {
display: flex;
}
.arrows {
display: block;
width: 40px;
cursor: pointer;
margin: .5em;
}
.right {
transform: rotateZ(180deg);
}
ul.carousel {
display: flex;
margin-bottom: 0;
li {
margin-right: 1em;
margin-bottom: 0;
padding: 2em;
&:last-child {
margin-right: 0;
}
}
}
.companies {
display: flex;
justify-content: space-between;
}
}
#media (min-width: 853px) {
body {
font-size: 20px;
}
.stats {
display: flex;
justify-content: space-between;
margin: 0;
}
.companies {
grid-template-columns: repeat(4, auto);
}
h1 {
font-size: 2.5em;
}
.subtitle {
font-size: 1.2em;
}
h2 {
text-align: left;
font-size: 2em;
}
.v-padding {
padding: 4em;
}
.light-purple-wrapper {
padding-bottom: 4em;
}
.move-up {
margin-top: -7em;
}
}
#media (min-width: 1200px) {
.stats li {
border-right: 1px solid rgb(124, 89, 148);
padding-right: 5%;
&:last-child {
border: none;
}
}
}

Navigation Links Overlapping

So basically I want my navigation bar to be fixed when I scroll the page down. But by changing its position from absolute to fixed, the links seem to overlap each other. Margin and Padding aren't working. How can I make them fixed and give some gap between each link? If there is something wrong with my code please correct me.
HTML
.container {
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-template-rows: repeat(12, 1fr);
width: 500px;
height: 500px;
grid-gap: 10px;
background-color: white;
width: 100%;
height: 1500px;
justify-content: center;
}
span {
font-size: 30px;
cursor: pointer;
}
#elem_1 {
background-color: #F7F7F7;
grid-column: 1 / -1;
grid-row: 1 / 2;
width: 100%;
}
#elem_1>img {
width: 2.3vw;
height: 4vh;
position: relative;
left: 220px;
bottom: 9px;
}
#elem_1>h1 {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: #505050;
position: relative;
left: 120px;
top: 30px;
}
nav a {
position: sticky;
right: 200px;
float: left;
margin-left: 20px;
text-decoration: none;
text-transform: uppercase;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-weight: 800;
color: grey;
}
#list_item_1 {
margin: 20px;
padding: 20px;
}
#nav_bar {
font-size: 20px;
}
nav a:hover {
background-color: pink;
}
nav {
display: block;
position: absolute;
bottom: 910px;
left: 1500px;
width: 100%;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav li {
margin-bottom: 5px;
margin: 12px;
}
#three_bars {
display: none;
}
#three_bars:checked~nav {
display: block;
}
#three_bars_label {
position: fixed;
right: 35px;
top: 35px;
}
#elem_2 {
background-color: greenyellow;
grid-column: 1 / -1;
grid-row: 2 / 3;
}
#elem_3 {
background-color: aliceblue;
grid-column: 1 / 9;
grid-row: 3 / 12;
}
#elem_4 {
background-color: antiquewhite;
grid-column: 9 / -1;
grid-row: 3 / 12;
}
#elem_5 {
background-color: aquamarine;
grid-column: 1 / -1;
grid-row: 12 / -1;
}
<div class="container">
<div id="elem_1">
<h1>RDMC</h1>
<img src="./Images/HeartBeat.png">
<input type="checkbox" id="three_bars">
<nav>
<ul><span id="nav_bar">
<li class="list_item_1">Home</li>
<li class="list_item">Donate</li>
<li class="list_item">About us</li>
<li class="list_item">Contact</li></span>
</ul>
</nav>
<label for="three_bars" id="three_bars_label">
<span><i class="fas fa-bars"></i></span>
</label>
</div>
<div id="elem_2">Content</div>
<div id="elem_3">Payment</div>
<div id="elem_4">Address</div>
<div id="elem_5">Contact</div>
</div>
The main problem I could see with your css was the bottom:910px; and left:1500px positioning : you don't know how big the user's screen is going to be (I couldn't see the nav initially! ) I commented them out for a start, moved your margin for the list items into the list_item_1 css (shorthand for margin order is top right bottom left - clockwise - so I wrote it shorthand integrating the margin-bottom of 5px). Also, I added a display:inline-block; to your nav li.
Another (important) point to mention is that I moved your nav a code to AFTER your nav/ nav ul/nav li/ css, as css is read in the order it is written. As such, you should keep your css in logical order.
Hope this helps
.container {
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-template-rows: repeat(12, 1fr);
width: 500px;
height: 500px;
grid-gap: 10px;
background-color: white;
width: 100%;
height: 1500px;
justify-content: center;
}
span {
font-size: 30px;
cursor: pointer;
}
#elem_1 {
background-color: #F7F7F7;
grid-column: 1 / -1;
grid-row: 1 / 2;
width: 100%;
}
#elem_1>img {
width: 2.3vw;
height: 4vh;
position: relative;
left: 220px;
bottom: 9px;
}
#elem_1>h1 {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: #505050;
position: relative;
left: 120px;
top: 30px;
}
#nav_bar {
font-size: 20px;
}
nav {
display: inline-block;
position: sticky;
/* bottom: 910px;*/
/*left: 1500px;*/
width: 100%;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
.list_item_1 {
margin: 12px 12px 5px 12px;
padding: 10px;
}
nav li {
display:inline-block;
/* margin: 12px 12px 5px 12px;*/
}
nav a {
display:inline-block;
float: left;
margin-left: 20px;
text-decoration: none;
text-transform: uppercase;
font-family: "Verdana", BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, sans-serif;
font-weight: 800;
color:#000000;
}
nav a:hover {
background-color: pink;
}
#three_bars {
display: none;
}
#three_bars:checked~nav {
display: block;
}
#three_bars_label {
position: fixed;
right: 35px;
top: 35px;
}
#elem_2 {
background-color: greenyellow;
grid-column: 1 / -1;
grid-row: 2 / 3;
}
#elem_3 {
background-color: aliceblue;
grid-column: 1 / 9;
grid-row: 3 / 12;
}
#elem_4 {
background-color: antiquewhite;
grid-column: 9 / -1;
grid-row: 3 / 12;
}
#elem_5 {
background-color: aquamarine;
grid-column: 1 / -1;
grid-row: 12 / -1;
}
<div class="container">
<div id="elem_1">
<h1>RDMC</h1>
<img src="./Images/HeartBeat.png">
<input type="checkbox" id="three_bars">
<nav>
<ul id="nav_bar">
<li class="list_item_1">Home</li>
<li class="list_item_1">Donate</li>
<li class="list_item_1">About us</li>
<li class="list_item_1">Contact</li>
</ul>
</nav>
<label for="three_bars" id="three_bars_label">
<span><i class="fas fa-bars"></i></span>
</label>
</div>
<div id="elem_2">Content</div>
<div id="elem_3">Payment</div>
<div id="elem_4">Address</div>
<div id="elem_5">Contact</div>
</div>

Mobile responsive have overflow-y

Trying to find issue two days and maybe I miss something. I create grid website. All working fine, but when is on mobile view have overflow-y. When I create template all be fine, and when start adding styles and colors, then problem start. I don't know why, if anyone can check code and tell me what I wrong. Thanks
:root {
--first: #7d9aff;
--hover: #9bbeff;
}
body {
font-family: 'Dosis', sans-serif;
max-height:100%;
margin: 0;
}
h1 { font-size: 70px }
h2 { font-size: 50px }
h3 { font-size: 30px }
h4 { font-size: 20px }
p { font-size: 18px }
a { text-decoration: none; }
ul.korisniLinkoiv {
padding-left: 7px;
font-size: 18px;
}
.korisniLinkoiv li {
list-style-type: none;
}
.korisniLinkoiv li a {
color: white;
}
.top,
.menu,
.features,
.webDesign,
.webHosting,
.servisRacunara,
.podrska {
margin: 15px;
font-size: 15px;
}
button {
background: var(--first);
color: white;
border: 0;
padding: 10px 20px;
}
button:hover {
background: #5979ce;
cursor: pointer;
}
#btn-large {
padding: 18px 55px;
font-size: 14px;
border-radius: 6px;
-webkit-box-shadow: 0 5px 7px rgba(155, 190, 255, 0.52);
-moz-box-shadow: 0 5px 7px rgba(155, 190, 255, 0.52);
box-shadow: 0 5px 7px rgba(155, 190, 255, 0.52);
-webkit-transition: all 0.3s ease 0.0s;
-moz-transition: all 0.3s ease 0.0s;
transition: all 0.3s ease 0.0s;
}
#btn-large:hover {
-webkit-transform: scale(1.1) rotate(4deg);
transform: scale(1.1) rotate(4deg);
}
img {
max-width: 100%;
}
/* .wrapper */
.wrapper {
display: grid;
grid-gap: 20px;
}
/* Top */
.top {
display: grid;
grid-gap: 20px;
grid-template-areas:
"hero hero cta1"
"hero hero cta2";
min-height: 97vh;
}
.hero {
grid-area: hero;
min-height: 400px;
background: url(assets/images/razvoj.jpg);
background-size: cover;
background-position: bottom right;
padding: 50px;
display: flex;
flex-direction: column;
align-items: start;
justify-content: center;
}
.hero > * {
background: var(--first);
padding: 5px;
}
.cta {
background: var(--first);
display: grid;
align-items: center;
justify-items: center;
align-content: center;
}
.cta p {
margin: 0;
}
.cta1 {
grid-area: cta1;
}
.cta2 {
grid-area: cta2;
}
.price {
font-size: 60px;
font-weight: 300;
}
/* Navigation */
.menu ul {
display: grid;
grid-gap: 10px;
padding: 0;
list-style: none;
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}
.menu li a {
display: grid;
grid-template-columns: 1fr;
align-items: center;
min-height: 34px;
background: var(--first);
color: #fff;
font-size: 14px;
}
.menu a {
display: block;
margin: 1px;
text-decoration: none;
padding: 10px;
text-align: center;
color: var(--black);
text-transform: uppercase;
font-size: 20px;
background: white;
box-shadow: 0 0 4px rgba(0,0,0,0.1);
}
.menu a:hover {
background: var(--hover);
color: white;
border-radius: 5px;
transition: ease-out 200ms;
}
[aria-controls="menu-list"] {
display: none;
}
/* Features! */
.features {
display: grid;
grid-gap: 20px;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.feature {
background: white;
padding: 10px;
border: 1px solid white;
text-align: center;
box-shadow: 0 0 4px rgba(0,0,0,0.1);
}
.feature p {
color: rgba(0,0,0,0.5);
}
.icon {
width: 130px;
}
/* webDesign, webHosting, servisRacunara, podrska Section */
.webDesign,
.webHosting,
.servisRacunara,
.podrska {
background: white;
padding: 50px;
min-height: 400px;
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 20px;
align-items: center;
justify-items: center;
}
.about {
background: url("assets/images/clouds.png");
}
img.about__mockup {
width: 350px;
}
/* Gallery */
.gallery {
display: grid;
grid-gap: 20px;
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}
.gallery img {
width: 100%;
}
/* Counter Statistika */
section.statistika {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
padding: 50px;
background-image: url("assets/images/stats.jpg");
background-size: cover;
background-position: bottom right;
}
.stats {
text-align: center;
font-size: 20px;
color: white;
}
.counter-value{
padding: 0 50px;
text-align: center;
font-size: 70px;
font-weight: 600;
color: white;
}
/* Kontakt */
.kontakt {
display: grid;
grid-template-columns: 1fr 1fr;
text-align: center;
justify-items: center;
align-items: center;
}
footer {
text-align: center;
}
/* Web Dizajn Page */
.website li a {
background: #9e027b;
}
.website a:hover {
background: #c3278b;
}
button.website {
background: #9e027b;
}
button.website:hover {
background: #c3278b;
}
.top-page {
display: grid;
grid-gap: 20px;
grid-template-columns: 1fr;
min-height: 200px;
}
.header-line {
min-height: 200px;
background: url(assets/images/trianglify.svg);
background-size: cover;
background-position: bottom right;
padding: 50px;
color: #000;
}
/* Portfolio section */
.portfolio h2 {
grid-column: 1 / -1;
display: grid;
grid-template-columns: 1fr auto 1fr;
grid-gap: 20px;
align-items: center;
}
.portfolio h2:before, .portfolio h2:after {
display: block;
content: '';
height: 10px;
background: linear-gradient(to var(--direction, left), var(--first), transparent);
}
.portfolio h2:after {
height: 10px;
--direction: right;
}
#media (max-width: 1000px) {
.menu {
order: -1;
perspective: 800px;
}
[aria-controls="menu-list"] {
display: block;
margin-bottom: 10px;
}
.menu ul {
max-height: 0;
overflow: hidden;
transform: rotateX(90deg);
transition: all 0.5s;
}
[aria-expanded="true"] ~ ul {
display: grid;
max-height: 500px;
transform: rotateX(0);
}
[aria-expanded="false"] .close {
display: none;
}
[aria-expanded="true"] .close {
display: inline-block;
}
[aria-expanded="true"]
[aria-expanded="true"] .open {
display: none;
}
}
#media (max-width: 700px) {
.top {
grid-template-areas:
"hero hero"
"cta1 cta2";
margin: 0;
}
.cta {
padding: 20px 0;
}
/* About */
.webDesign,
.webHosting,
.servisRacunara,
.podrska,
.statistika,
.kontakt{
grid-template-columns: 1fr;
}
.about__mockup {
order: -1;
}
section.statistika {
grid-template-columns: 1fr;
}
}
#media (max-width: 500px) {
.top {
grid-template-areas:
"hero"
"cta1"
"cta2"
}
.header-info h1 {
font-size: 34px;
}
.menu {
margin: 0;
}
.cta {
padding: 20px 0;
}
.about__mockup {
order: -1;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Dosis" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<title>iDizajner - Web Dizajn Srbija | Izrada web sajtova, izrada web prodavnica</title>
</head>
<body>
<div class="wrapper">
<div class="top-page">
<header class="header-line">
<nav class="menu website">
<button aria-expanded="false" aria-controls="menu-list" class="website">
<span class="open">Ξ</span>
<span class="close">X</span>
Meni
</button>
<ul id="menu-list">
<li>
Web Dizajn
</li>
<li>
Web Hosting
</li>
<li>
Servis Računara
</li>
<li>
Podrška
</li>
<li>
Kontakt
</li>
</ul>
</nav>
<div class="header-info">
<h1>Web Dizajn</h1>
<p>Budite u korak sa vremenom!</p>
</div>
</header>
</div>
<section class="webDesign about">
<img src="assets/images/icon/webDizajn.svg" alt="" class="about__mockup">
<div class="about about__webDesign">
<h2>WEB DIZAJN</h2>
<p>Neki tekst bi isto trebao da ide ovde ali moze da saceka</p>
<p>Jos jedan tekst nekog obisa</p>
<button id="btn-large">PROČITAJ VIŠE</button>
</div>
</section>
<section class="webHosting">
<div class="about__webHosting">
<h2>WEB HOSTING</h2>
<p>Neki tekst bi isto trebao da ide ovde ali moze da saceka</p>
<p>Jos jedan tekst nekog obisa</p>
<button id="btn-large">PROČITAJ VIŠE</button>
</div>
<img src="assets/images/icon/webHosting.svg" alt="" class="about__mockup">
</section>
<section class="servisRacunara about">
<img src="assets/images/icon/servisRacunara.svg" alt="" class="about__mockup">
<div class="about__servisRacunara">
<h2>SERVIS RAČUNARA</h2>
<p>Neki tekst bi isto trebao da ide ovde ali moze da saceka</p>
<p>Jos jedan tekst nekog obisa</p>
<button id="btn-large">PROČITAJ VIŠE</button>
</div>
</section>
<section class="podrska">
<div class="about__podrska">
<h2>PODRŠKA</h2>
<p>Neki tekst bi isto trebao da ide ovde ali moze da saceka</p>
<p>Jos jedan tekst nekog obisa</p>
<button id="btn-large">PROČITAJ VIŠE</button>
</div>
<img src="assets/images/icon/podrska.svg" alt="" class="about__mockup">
</section>
<section class="statistika">
<div class="stats">
<div class="counter-value" data-count="39">0</div>
Klijenti
</div>
<div class="stats">
<div class="counter-value" data-count="77">0</div>
Projekti
</div>
<div class="stats">
<div class="counter-value" data-count="3">0</div>
Partner Agencije
</div>
</section>
<section class="kontakt">
<img src="assets/images/kontakt.png" alt="">
<div class="naruci">
<h3>Potreban vam je web sajt?</h3>
<a href="#">
<button id="btn-large">NARUČI ODMAH</button>
</a>
</div>
</section>
<footer>
<p>iDizajner 2018</p>
</footer>
</div>
<script>
const navButton = document.querySelector('button[aria-expanded]');
function toggleNav({ target }) {
const expanded = target.getAttribute('aria-expanded') === 'true' || false;
navButton.setAttribute('aria-expanded', !expanded);
}
navButton.addEventListener('click', toggleNav);
// counter statistika
var a = 0;
$(window).scroll(function() {
var oTop = $('.statistika').offset().top - window.innerHeight;
if (a == 0 && $(window).scrollTop() > oTop) {
$('.counter-value').each(function() {
var $this = $(this),
countTo = $this.attr('data-count');
$({
countNum: $this.text()
}).animate({
countNum: countTo
},
{
duration: 6000,
easing: 'swing',
step: function() {
$this.text(Math.floor(this.countNum));
},
complete: function() {
$this.text(this.countNum);
//alert('finished');
}
});
});
a = 1;
}
});
</script>
</body>
</html>
You need to remove some margin on the different sections. It works with 10px:
.top, .menu, .features, .webDesign, .webHosting, .servisRacunara, .podrska {
margin: 10px;
font-size: 15px;
}
It happens because you have an image with width that expands content on mobile resolution:
<img src="assets/images/icon/webDizajn.svg" alt="" class="about__mockup">

Flexbox not working in Chrome or Safari but works in Firefox

Flexbox isn't working in Chrome or Safari but works fine in Firefox. The vertical images are expanding to not fit within their container, but in Firefox they're behaving as I want them to. Here is the code, any idea? Thanks.
body{ max-width: 1970px;
margin: 0 auto;
padding: 0 2%;
box-sizing: border-box;
padding-top: 100px;
}
a {
text-decoration: none;
font-family: 'Karla', sans-serif;
font-size: 1em;
letter-spacing: -0.03em;
}
img {
max-width: 100%;
}
/***********************************
HEADING
************************************/
header {
float: left;
position:fixed;
top:0;
width: 100%;
z-index: 99;
background-color: white;
}
h1 {
font-family: 'Giorgio Sans Web', sans-serif;
margin: 0 auto;
font-size:4.5em;
font-weight: 700;
font-style: normal;
font-stretch: normal;
}
h2 {
font-family: 'Giorgio Sans Web', sans-serif;
margin: 0 auto;
font-size:4em;
font-weight: 700;
font-style: normal;
font-stretch: normal;
line-height: 3em;
}
h3 {
font-family: 'Karla', sans-serif;
font-weight: 400;
font-size:1.3em;
margin: 0 0 1em 0;
}
h4 {
font-family: 'Giorgio Sans Web', sans-serif;
margin: 0 auto;
font-size:2.5em;
font-weight: 700;
letter-spacing:0.0625em;
font-style: normal;
font-stretch: normal;
}
h5 {
font-family: 'Karla', sans-serif;
font-weight: 700;
font-size: 0.75em;
line-height: 1.2em;
}
p {
font-family: 'Karla', sans-serif;
line-height: 1.5em;
font-size: 1.2em;
letter-spacing: -0.03em;
}
/***********************************
NAVIGATION
************************************/
nav {
/*text-align: center;
margin: 0 2%;
box-sizing: border-box;*/
background-color: white;
}
#nav-parent {
height:;
display:flex;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
padding: 10px 3%;
margin: 0 auto;
}
.nav-icon {
flex-basis:auto;
}
#logo {
flex-basis:auto;
box-sizing: border-box;
padding-left: 20px;
}
.contact-button {
flex-basis:auto;
}
nav li a {
padding:0;
}
/***********************************
SIDE NAV
************************************/
.sidenav {
height: 100%;
width: 0;
position: fixed;
z-index: 100;
top: 0;
left: 0;
background-color: #F3F3F3;
overflow-x: hidden;
transition: 0.5s;
padding-top: 20px;
}
#sidenav-content {
margin-left: 13px;
}
.sidenav a {
text-decoration: none;
color: #000;
display: block;
transition: 0.3s;
}
.sidenav a h4 {
overflow: hidden;
white-space: nowrap;
padding: 16px 8px 0px 6px;
color: #000;
display: block;
transition: 0.1s;
}
.sidenav p {
padding: 0px 8px 8px 26px;
font-size: 16px;
color: #000;
display: block;
transition: 0.3s;
width: 250px;
}
.slide-nav-link {
margin-top: 10px;
padding: 8px 8px 8px 26px;
line-height: 2.2em;
}
.slide-nav-social {
width: 150px;
height:50px;
margin-top: 20px;
margin-left: 26px;
}
.slide-nav-social a {
width:20px;
padding: 0 15px 0 0;
display: inline-block;
}
.sidenav a:hover, .offcanvas a:focus{
color: #6B00FF;
}
.sidenav .closebtn {
padding: 15px 8px 8px 26px;
font-size: 30px;
margin-left: 0px;
}
.closebtn a:hover {
color: #000;
}
#media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}
/***********************************
FOOTER
************************************/
footer {
font-size: 0.75em;
text-align: center;
clear: both;
padding-top: 50px;
color: #ccc;
}
.social-icon {
width:20px;
height: 20px;
margin: 0 5px;
}
/***********************************
PAGE: PORTFOLIO
************************************/
.gallery{
margin: 0 auto;
list-style: none;
padding-left: 0;
}
.gallery figure {
overflow: hidden;
float: left;
width: 48%;
margin: 1%;
z-index: 97;
position: relative;
float: left;
}
.gallery figcaption {
background: rgba(255,255,255,0.97);
display : flex;
align-items : center;
text-align: center;
color: white;
float: left;
position: absolute;
left: 0;
opacity: 0;
right: 0;
top: 0;
height:100%;
z-index: 98;
-webkit-transition: all 300ms;
-moz-transition: all 300ms;
transition: all 300ms;
-webkit-transition-delay: 100ms;
-moz-transition-delay: 100ms;
transition-delay: 100ms;
}
.gallery figcaption h3 {
width:100%;
text-align: center;
color:#000;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
transition: all 300ms ease-out;
}
.gallery li:hover figcaption {
opacity: 1;
}
/***********************************
PAGE: Project
************************************/
.project-gallery{
margin: 0 auto;
padding: 0 1.5%;
list-style: none;
}
.project-gallery img{
max-width: 100%;
margin: 1.5% 0;
}
.project-gallery hr {
margin: 40px 0;
border: none;
height: 3px;
background-color: #000;
}
.project-title {
max-width: 100%;
text-align: center;
padding-top: 40px;
}
.description-text {
display:inline;
}
.left-column-text {
width:30%;
margin-left: 5%;
margin-top: 8px;
display:inline-block;
vertical-align: top;
}
.left-column-text p {
margin: 10px 0 25px 0;
}
.left-column-text h5 {
margin-bottom: -5px;
}
.right-column-text {
width:50%;
margin: 0 5% 0 8%;
display:inline-block;
vertical-align: top;
}
.vertical-imgs {
display: -webkit-flex; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-flex; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display:flex;
justify-content: space-between;
margin: 1% 0;
}
.vertical-img-left {
box-sizing: border-box;
padding-right: 3%;
}
.vertical-img-right {
box-sizing: border-box;
}
.prev-next-buttons {
margin-right: -3.7%;
}
.prev-next-buttons a {
display: inline-block;
margin: 0;
box-sizing: border-box;
padding: 20px 5%;
}
.prev-button {
width:48%;
}
.next-button {
text-align: right;
width:48%;
}
/***********************************
PAGE: About
************************************/
.profile-photo {
display: block;
max-width: 150px;
margin: 0 auto 30px;
border-radius: 100%;
}
/***********************************
PAGE: CONTACT
************************************/
.contact-info {
list-style: none;
padding: 0;
margin: 0;
font-size: 0.9em;
}
.contact-info a {
display: block;
min-height: 20px;
background-repeat: no-repeat;
background-size: 20px 20px;
padding: 0 0 0 30px;
margin: 0 0 10px;
}
.contact-info li.mail a {
background-image: url('../img/mail.png')
}
.contact-info li.twitter a {
background-image: url('../img/twitter.png')
}
.contact-info li.phone a {
background-image: url('../img/phone.png')
}
/***********************************
COLORS
************************************/
/* site body */
body {
background-color: #fff;
color:#000;
}
/*green header
header {
background: #6ab47b;
border-color: #599a68;
}*/
/*nav background on mobile
nav {
background: #599a68;
}*/
/*logo text */
h1 {
color: #000;
}
/*link color*/
a {
color:#000
}
/*nav link colors*/
nav a, nav a:visited {
color: #000;
}
/* selected nav link colors*/
nav a.selected, nav a:hover {
color: #5513FE
}
/* selected prev next link colors*/
a h1.selected, a h1:hover {
color: #5513FE
}
a h4.selected, a h4:hover {
color: #5513FE
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cari Sekendur - MHG Modern Classic</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" type="text/css" href="fonts/1606-HQIULX.css">
<link href="https://fonts.googleapis.com/css?family=Karla:400,400i,700,700i" rel="stylesheet">
<link rel="stylesheet" href="css/main1.css">
<link rel="stylesheet" href="css/responsive.css">
<meta name="viewport" content= "width=device-width, initial-scale=1.0">
</head>
<body>
<header>
<nav>
<ul id="nav-parent">
<li class="nav-icon">
<span style="cursor:pointer" onclick="openNav()"
</span>
<img src="img/nav-icon.svg" class="nav-icon">
</li>
<li id="nav-icon">
<a href="index.html" id="logo">
<h1>CARI</h1>
</a>
</li>
<li class="nav-icon">
Contact
</li>
</ul>
</nav>
</header>
<div id="mySidenav" class="sidenav">
<div id="sidenav-content">
<img src="img/nav-icon-open.svg" class="nav-icon">
<div class= "slide-nav-link">
Work
About
Contact
</div>
<div class= "slide-nav-text">
<a href="index.html" id="logo">
<h4>CARI SEKENDUR</h4>
</a>
<p>Creating visual experiences that make the complex clear and the average exceptional.</p>
</div>
<div class= "slide-nav-social">
<img src="img/WNWlogo.svg">
<img src="img/linkedin-black.svg">
<img src="img/pinterest-black.svg">
</div>
</div>
</div>
<!--Click on the element below to open the side navigation menu.-->
<script>
function openNav() {
document.getElementById("mySidenav").style.width = "350px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
</script>
<div class="wrapper">
<section class="project-gallery">
<div class="horiztonal-img">
<img src="img/mhg-zine/CARI_MHG_ZINE_1.gif" alt="">
</div>
<div class="project-title">
<h2>MORGANS HOTEL GROUP - MODERN CLASSIC ZINE</h2>
</div>
<hr>
<div class="description-text">
<div class="left-column-text">
<h5>STUDIO</h5>
<p>LMNOP Creative</p>
<h5>CREATIVE DIRECTION</h5>
<p>Leigh Nelson</p>
<h5>DESIGN</h5>
<p>Cari Sekendur, Leigh Nelson, Heidi Chisholm</p>
</div>
<div class="right-column-text">
<p> Morgans Hotel Group launched the global phenomenon of boutique hotels 20 years ago, and to celebrate their rich history they put together a campaign called The Modern Classic. Each of Morgans' properties has a design aesthetic that is unlike anything you've seen before, awe-inspiring and always over-the-top. So, to capture the essence of Morgans' brand, we concepted, designed, and printed a zine for them to distribute to hotel guests. This project was a print designer's dream, complete with gold-holographic foil, gold staples, fluorescent Pantone inks, collage, illustration, a tear-out poster, and even a little pack of temporary tattoos.
</p>
</div>
<hr>
</div>
<div class="horiztonal-img">
<img src="img/mhg-zine/CARI_MHG_ZINE_2.jpg" alt="">
</div>
<div class="vertical-imgs">
<img src="img/mhg-zine/CARI_MHG_ZINE_8.jpg" alt="" class="vertical-img-left">
<img src="img/mhg-zine/CARI_MHG_ZINE_5.jpg" alt="" class="vertical-img-right">
</div>
<div class="horiztonal-img">
<img src="img/mhg-zine/CARI_MHG_ZINE_7.jpg" alt="">
</div>
<div class="prev-next-buttons">
<a href="#" class="prev-button">
<h2>PREVIOUS</h2>
</a>
<a href="#" class="next-button">
<h2>NEXT</h2>
</a>
</div>
<hr class="bottom-hr" style="margin-top: 0px;">
</section>
<footer>
<p></p>
</footer>
</div>
</body>
</html>
use :
#nav-parent {
display:flex;
display: -webkit-flex;
-webkit-flex-flow: initial;
flex-flow: initial;
justify-content: space-between;
align-items: center;
padding: 10px 3%;
margin: 0 auto;
}

Centering a content in all devices using padding-top

I have been having trouble centering the .content div in any device. In some devices, the .content is exactly centered but not in others. I use padding-top to push the .content down so it could be placed on the center of any device. What should I do to center the .content in any device using padding-top? Should I use Javascript in this kind of situation?
body {
margin: 0;
}
.whole {
height: 100vh;
background: #d44949;
}
header:after {
content: '';
display: table;
clear: both;
}
.logo {
font: 1.4em 'Open Sans',sans-serif;
color: #fcfcfc;
text-transform: uppercase;
float: left;
margin-left: 15px;
}
.logo > span {
font-style: italic;
color: #d8d8d8;
}
.header-nav {
float: right;
margin: 20px 15px 0 0;
}
.header-nav > a {
color: #fafafa;
text-decoration: none;
font: 1em 'Open Sans',sans-serif;
font-weight: 300;
}
.header-nav > a:not(:first-child) {
margin-left: 15px;
}
.header-nav > a:hover {
color: yellow;
}
.content {
display: flex;
flex-direction: column;
padding-top: calc(100vh / 2);
}
.content > img {
width: 200px;
height: 200px;
border-radius: 50%;
margin: auto;
}
.content-nav {
margin: auto;
padding-top: 20px;
}
.content-nav > a {
color: #fafafa;
text-decoration: none;
font: 1em 'Open Sans',sans-serif;
font-weight: 300;
}
.content-nav > a:not(:first-child) {
margin-left: 10px;
}
<div class="whole">
<header>
<h1 class="logo">Max<span>&</span>Spoon</h1>
<div class="header-nav">
Download
Docs
Tutorial
Reference
</div>
</header>
<div class="content">
<img src="http://emblemsbf.com/img/36593.jpg" alt="logo">
<div class="content-nav">
Home
Blog
Forum
Stuff
</div>
</div>
</div>
As you are already using flex you could remove the padding-top and add align-items: center; to your .content.
So your CSS for .content becomes:
.content {
display: flex;
flex-direction: column;
align-items: center;
}
Here's the updated snippet.
body {
margin: 0;
}
.whole {
height: 100vh;
background: #d44949;
}
header:after {
content: '';
display: table;
clear: both;
}
.logo {
font: 1.4em'Open Sans', sans-serif;
color: #fcfcfc;
text-transform: uppercase;
float: left;
margin-left: 15px;
}
.logo > span {
font-style: italic;
color: #d8d8d8;
}
.header-nav {
float: right;
margin: 20px 15px 0 0;
}
.header-nav > a {
color: #fafafa;
text-decoration: none;
font: 1em'Open Sans', sans-serif;
font-weight: 300;
}
.header-nav > a:not(:first-child) {
margin-left: 15px;
}
.header-nav > a:hover {
color: yellow;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
}
.content > img {
width: 200px;
height: 200px;
border-radius: 50%;
margin: auto;
}
.content-nav {
margin: auto;
padding-top: 20px;
}
.content-nav > a {
color: #fafafa;
text-decoration: none;
font: 1em'Open Sans', sans-serif;
font-weight: 300;
}
.content-nav > a:not(:first-child) {
margin-left: 10px;
}
<div class="whole">
<header>
<h1 class="logo">Max<span>&</span>Spoon</h1>
<div class="header-nav">
Download
Docs
Tutorial
Reference
</div>
</header>
<div class="content">
<img src="http://emblemsbf.com/img/36593.jpg" alt="logo">
<div class="content-nav">
Home
Blog
Forum
Stuff
</div>
</div>
</div>

Resources