Strange behavior when hovering/clicking an element - html

I get a really strange behavior on a very simple html landing page.
The page is the following: http://fw2019.gosrl.webfactional.com/
If you try to click on any link (FB icon, Instagram icon, years of the previous edition) the yellow shape on the background suddenly move to the right.
The page is pure html + css, with no javascript attached.
I've tried to:
- deactivate any transition/animation when hovering Social Icons
- check if I get the same behavior at a lower resolution -> YES
html,
body {
margin: 0;
height: 100%;
font-family: "Open Sans", arial, sans-serif;
}
.main-image {}
.main-image img {
margin: 30px auto;
display: block;
max-width: 600px;
width: 100%;
}
.content-wrapper,
.fake-content-wrapper {
position: absolute;
text-align: center;
width: 1636px;
height: 562px;
background: url(/wp-content/asset/grid-svg-4-01.svg);
overflow: hidden;
margin: 0 auto;
z-index: 99;
}
.fake-content-wrapper {
position: absolute;
overflow: visible;
left: 50%;
top: -130px;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
background: transparent;
z-index: 56;
}
.content-wrapper p {
text-align: center;
margin-bottom: 5px;
margin-top: 0;
}
.content-wrapper h1 {
text-align: center;
margin-top: 0;
}
.main-container {
display: table;
width: 100%;
height: 100%;
}
.main-content {
vertical-align: middle;
position: relative;
height: 100%;
padding: 0;
margin: 0;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
}
.titolo {
display: inline-block;
width: 772px;
height: 208px;
position: absolute;
top: 176px;
left: 345px;
background: #fff;
margin: 0;
padding: 32px 25px;
box-sizing: border-box;
margin-left: 1px;
margin-top: 1px;
font-family: titling-gothic-fb-wide, sans-serif;
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 64px;
line-height: 70px;
z-index: 999;
text-align: left;
}
.logo-container {
background: #000;
width: 171px;
height: 138px;
position: absolute;
left: 1120px;
top: 212px;
padding: 28px;
box-sizing: border-box !important;
z-index: 999;
}
.logo-container img {
width: 100%;
}
.sponsor-container {
position: absolute;
right: 260px;
top: 37px;
background: #fff;
width: 428px;
height: 68px;
padding: 8px;
box-sizing: border-box;
text-align: center;
z-index: 999;
}
.date-container {
box-sizing: border-box;
background: #fff;
position: absolute;
width: 944px;
left: 346px;
top: 422px;
text-align: center;
z-index: 999;
font-family: "Space Mono", monospace;
padding: 6px 10px;
}
.date-container>div {
display: inline-block;
text-transform: uppercase;
padding: 0;
margin-right: 10px;
font-size: 56px;
line-height: 100%;
}
.date-container .light {
font-weight: 400;
}
.date-container .bold {
font-weight: 700;
}
.blue-box {
box-sizing: border-box;
width: 256px;
height: 0;
background-color: rgba(0, 157, 255, 1);
position: absolute;
background-position: -2px -2px;
right: 2px;
bottom: 2px;
height: 138px;
z-index: 0 !important;
animation-name: enlarge;
animation-duration: 5s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
animation-delay: 1s;
animation-timing-function: linear;
}
#keyframes enlarge {
from {
height: 0;
}
to {
height: 560px;
}
}
#keyframes slide {
0% {
transform: translateY(0);
}
100% {
transform: translateY(-1000px);
}
}
.red-circle {
position: absolute;
left: 40px;
top: 2px;
height: 558px;
width: 562px;
display: inline-block;
box-sizing: border-box;
background-color: #ff003f;
background-position: 130px 136px;
border: 2px solid #000;
border-radius: 1000000px;
z-index: 9;
}
.skate-park {
/* width: 1636px;
height: 1200px; */
position: absolute;
display: block;
background: url(http://fw2019.gosrl.webfactional.com/wp-content/uploads/2019/07/skate-bg-2.png);
/* left: -47px;)
top: 102px; */
background-size: cover;
top: -45px;
left: 300px;
height: 200vh;
width: 100vw;
}
.fake-content-wrapper#circle {
top: 203px;
}
.fake-content-wrapper#rect {
top: 333px;
}
.content-wrapper#skate {
overflow: hidden;
background: none;
position: fixed;
left: -10%;
height: 200vh;
width: 200vw;
position: fixed;
}
.content-wrapper#skate .skate-park {
position: relative;
/* top: -140px; */
}
/* ANIMAZIONE */
/* .blue-box {
animation-name: bluebox;
animation-duration: 20s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
#keyframes bluebox {
0% {transform: translate(0,0);}
6.39% {transform: translate(0,-210px);}
43.61% {transform: translate(-1376px,-210px);}
55.58% {transform: translate(-1376px,210px);}
92.8% {transform: translate(0px,210px);}
100% {transform: translate(0px,0);}
} */
.previous h3,
.previous a {
display: inline-block;
margin-right: 10px;
}
.previous a:last-child {
margin-right: 0;
}
.previous h3 {
font-family: titling-gothic-fb-narrow, sans-serif;
margin-block-start: 0px;
margin-block-end: 0px;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
margin-right: 10px;
font-weight: 500;
}
.previous a {
font-family: "Space Mono", monospace;
color: #000;
text-decoration: none;
margin-right: 5px;
}
.previous a:hover {
text-decoration: underline;
}
.content-wrapper#footer {
overflow: visible;
background: none;
}
.previous,
.social {
position: absolute;
bottom: -40px;
top: auto;
right: 0;
padding-top: 10px;
padding-bottom: 10px;
}
.social {
bottom: -50px;
left: 0;
right: auto;
}
.social img {
height: 30px;
}
.social a {
margin-right: 5px;
}
.social a img {
transition: all 0.5s ease;
}
/* .social a:hover img {
transform: rotateY(360deg);
} */
#media screen and (max-width: 1919px) and (min-width: 1366px) {
.content-wrapper,
.fake-content-wrapper {
width: 1292px;
}
.titolo,
.date-container {
left: 173px;
}
.date-container {
width: 772px;
left: 174px;
}
.logo-container {
left: 948px;
}
.fake-content-wrapper#circle {
top: 196px;
}
.fake-content-wrapper#rect {
top: 326px;
}
/* .skate-park {
left: -360px;
} */
.date-container>div {
font-size: 46px;
padding-top: 5px;
padding-bottom: 5px;
}
.blue-box {
bottom: -200px;
top: auto;
width: 170px;
}
#keyframes enlarge {
from {
height: 0;
}
to {
height: 760px;
}
}
}
#media screen and (max-width: 1365px) and (min-width: 1024px) {
.content-wrapper {
width: 862px;
}
.sponsor-container {
right: 88px;
}
.titolo,
.date-container {
left: 1px;
width: 686px;
}
.date-container {
left: 2px;
}
.date-container>div {
font-size: 40px;
left: 2px;
padding-top: 8px;
padding-bottom: 8px;
}
.blue-box {
bottom: 2px;
top: auto;
width: 170px;
}
.logo-container {
left: 689px;
}
.content-wrapper#skate {
left: -20%;
width: 200%;
}
}
#media screen and (max-width: 1023px) and (min-width: 768px) {
.content-wrapper {
width: 604px;
}
.sponsor-container {
right: 2px;
}
.titolo {
left: 1px;
font-size: 60px;
width: 600px;
}
.date-container {
left: 2px;
width: 600px;
}
.date-container>div {
font-size: 35px;
margin-right: 4px;
padding-top: 11px;
padding-bottom: 11px;
}
.logo-container {
left: 2px;
top: 37px;
}
.blue-box {
width: 170px;
}
.content-wrapper#skate {
left: -30%;
}
}
#media screen and (max-width: 767px) and (min-width: 375px) {
.content-wrapper {
width: 346px;
}
.titolo {
left: 1px;
font-size: 41px;
line-height: 43px;
height: 138px;
width: 342px;
padding-top: 8px;
}
.logo-container {
top: 37px;
left: 2px;
}
.date-container {
width: 342px;
left: 2px;
top: 352px;
padding: 4.5px;
}
.date-container>div {
font-size: 18px;
line-height: 18px;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
}
.sponsor-container {
left: 2px;
width: 342px;
bottom: 37px;
top: auto;
}
.sponsor-container img {
width: 100%;
padding-left: 10px;
padding-right: 10px;
box-sizing: border-box;
}
.previous h3 {
display: block;
text-align: right;
}
.previous {
bottom: -60px;
}
.blue-box {
width: 170px;
}
.content-wrapper#skate {
left: -50%;
}
.skate-park {
top: -100px;
left: 300px;
width: 150vw;
}
.titolo {
font-size: 32px;
padding-top: 5px;
}
}
#media screen and (max-width: 374px) {
.content-wrapper {
width: 259.5px;
}
.logo-container {
top: 37px;
left: 2px;
}
.titolo {
left: 1px;
font-size: 28px;
line-height: 32px;
width: 256px;
height: 173px;
}
.date-container {
left: 2px;
width: 256px;
top: 387px;
height: 68px;
}
.date-container>div {
font-size: 14px;
margin: 0;
padding-top: 21px;
}
.sponsor-container {
width: 256px;
left: 2px;
bottom: 2px;
top: auto;
}
.sponsor-container img {
width: 100%;
padding-left: 10px;
padding-right: 10px;
box-sizing: border-box;
padding-top: 8px;
}
.previous h3 {
display: block;
text-align: right;
}
.previous {
bottom: -60px;
}
.blue-box {
width: 84px;
}
.content-wrapper#skate {
left: -50%;
width: 400vw;
}
.previous {
display: block;
width: 100%;
clear: both;
text-align: right;
bottom: -100px;
}
.social {
text-align: left;
}
.skate-park {
left: 200px;
}
.main-content {
align-items: baseline;
}
body {
padding-top: 25px;
padding-bottom: 25px;
}
.content-wrapper#skate {
top: 0;
}
.content-wrapper#skate {
top: -400px;
}
}
/* CELL ORIZZONTALI */
#media screen and (max-height: 500px) and (orientation: landscape) {
.main-content {
align-items: baseline;
}
body {
padding-top: 25px;
padding-bottom: 25px;
}
.content-wrapper#skate {
top: 0;
}
}
/* RETINA */
#media screen and (-webkit-min-device-pixel-ratio: 2),
(min-width: 1921px) {
.skate-park {
left: 13.5%;
top: -10%;
}
}
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<title>Festiwall 2019 | 9 - 15 Settembre 2019 | Ragusa</title>
<link rel="stylesheet" href="https://use.typekit.net/qse6gsn.css">
<link href="https://fonts.googleapis.com/css?family=Space+Mono:400,700&display=swap" rel="stylesheet">
</head>
<body>
<div class="main-container">
<div class="main-content">
<div class="content-wrapper" id="circle">
<div class="red-circle"></div>
</div>
<div class="content-wrapper" id="skate">
<div class="skate-park"></div>
</div>
<div class="content-wrapper" id="rect">
<div class="blue-box"></div>
</div>
<div class="content-wrapper">
<h2 class="titolo">Public Art<br>Festival</h2>
<div class="logo-container">
<img src="/wp-content/uploads/2019/07/festiwall-2019-logo.png" alt="Festiwall 2019 logo">
</div>
<div class="sponsor-container">
<img src="/wp-content/uploads/2019/07/festiwall-2019-sponsor.png" alt="Festiwall 2019 Sponsor">
</div>
<div class="date-container">
<div class="light">09/15</div>
<div class="bold">September</div>
<div class="light">2019</div>
<div class="bold">Ragusa</div>
</div>
</div>
<div class="content-wrapper" id="footer">
<div class="social">
<img src="/wp-content/uploads/2019/07/fw2019-icons-_0001_fb.png" alt="Facebook">
<img src="/wp-content/uploads/2019/07/fw2019-icons-_0000_inst.png" alt="Instagram">
</div>
<div class="previous">
<h3>Edizioni precedenti</h3>
2015 / 2016 / 2017 / <a href="http://www.festiwall.it/2018"
title="Festiwall 2016">2018</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Thank you for those who are willing to give support :)
Antonio

Related

Why does the text not appear in the div that I place it in?

Im making a pricing page for my website but as I'm making my website responsive, (only when the page is less than 110 pixels wide),
* {
margin: 0;
padding: 0;
font-family: "Poppins", sans-serif;
}
#pricing {
height: 95vh;
width: 100vw;
background-color: #E5EDFB;
margin-top: none;
}
h1 {
color: #0E0A24;
padding-left: 8.75%;
padding-top: 5vh;
font-size: 300%;
}
h2 {
color: #0E0A24;
text-align: center;
margin-top: 4vh;
font-weight: 600;
font-size: 175%;
}
p {
color: #0E0A24;
text-align: center;
font-weight: 300;
}
span {
font-size: 120%;
font-weight: 400;
}
.smallTile {
background-color: white;
width: 23vw;
height: 65%;
border-radius: 15px;
}
.largeTile {
background-color: white;
width: 28vw;
height: 70%;
border-radius: 15px;
}
#photo {
margin-left: 8.75%;
position: relative;
top: 27%;
transform: translateY(-27%);
float: left;
}
#video {
margin-right: 8.75%;
position: relative;
top: 27%;
transform: translateY(-27%);
float: right;
}
#combo {
margin-right: 8.75%;
position: absolute;
left: 50%;
top: 60%;
transform: translate(-50%, -60%);
}
hr {
margin-top: 6%;
margin-bottom: 6%;
width: 20%;
position: relative;
left: 50%;
transform: translateX(-50%);
background-color: #0E0A24;
border: none;
height: 0.1px;
;
}
.topHR {
width: 50%;
margin-top: 4vh;
margin-bottom: 4vh;
height: 2px;
border-radius: 1px;
;
}
#comboHeader {
font-weight: 900;
font-size: 200%;
}
#media screen and (max-width: 1100px) {
body {
background-color: red;
}
.smallTile {
display: block;
position: relative;
width: 86vw;
height: 95vh;
}
.largeTile {
display: block;
position: relative;
width: 86vw;
}
#photo {}
#video {
margin-top: 100vh;
}
#combo {
margin-top: 100vh;
position: relative;
}
h1 {
margin-bottom: 20px;
}
}
<div id=p ricing>
<h1>Our Pricing:</h1>
<div class="smallTile" id="photo">
<h2>Photography<br>Plan</h2>
<hr class="topHR">
<p><span>0 - 10 Pictures</span><br>$100</p>
<hr>
<p><span>10 - 20 Pictures</span><br>$175</p>
<hr>
<p><span>20+ Pictures</span><br>$250</p>
</div>
<div class="smallTile" id="video">
<h2>Videography<br>Plan</h2>
<hr class="topHR">
<p><span>0 - 5 Videos</span><br>$100</p>
<hr>
<p><span>5 - 10 Videos</span><br>$150</p>
<hr>
<p><span>Edited Video</span><br>Additional $50</p>
</div>
<div class="largeTile" id="combo">
<h2 id="comboHeader">Combo<br>Plan</h2>
<hr class="topHR">
<p><span>Combined price of both plans</span><br>$50 Reduced</p>
<hr>
</div>
</div>
I noticed that the combo package text is at the bottom of the page instead of in the div where I placed it. Additionally, is it possible to change the order of the divs so that the combo package is last on the responsive site only? Thanks for your help in advance!
I noticed you did not specify the float value for the combo div. Add float to the combo styles as such:
#combo{
margin-right: 8.75%;
position: absolute;
left: 50%;
top: 60%;
transform: translate(-50%, -60%);
float: left;
}

Can't make valid responsive website because positioning

I try to make a responsive website but I tend to believe because I'm using positiong + right and left it makes me some serious problems. I need to do that without grid.
That's what happens when I make the window a little bit smaller, some of it go left: https://i.imagesup.co/images2/cdf13e4d1939b4041c55ab3b59799762e3d8f32d.png.
And when it gets to the media query it's definitely not responsive. Every change in the window size under 786px seem differently.
https://i.imagesup.co/images2/007f47c1df59bdf745a531d55c9c8965270508aa.png
Only the what inside the first white box + what's inside + what above is really responsive.
CSS
body {
margin: auto 0;
direction: rtl;
background-color:#F0F0F0;
}
.img-center {
display: block;
margin: 0 auto;
}
#img-below {
border: 5px solid white;
border-radius: 100%;
height: 8%;
width: 8%;
position: relative;
bottom: 80px;
}
h1 {
color:#0099ff;
text-align: center;
position: relative;
bottom: 120px;
font-size: 50px;
font-family: 'M PLUS Rounded 1c', sans-serif;
}
h2 {
color: gray;
font-size: 30px;
text-align: center;
font-size: 30px;
position: relative;
bottom: 157px;
font-family: 'M PLUS Rounded 1c', sans-serif;
}
.icons {
height: 50px;
width: 50px;
border: #0099ff 5px solid;
padding: 5px;
border-radius: 100%;;
margin-right: 15px;
}
#DivIcons {
display: flex;
flex-direction: row;
justify-content: center;
position: relative;
bottom: 170px;
}
p {
font-family: 'M PLUS Rounded 1c', sans-serif;
font-size: 15px;
}
article {
width: 160px;
margin-bottom: 5px;
position: relative;
bottom: 455px;
right: 397px;
}
h3 {
font-family: 'M PLUS Rounded 1c', sans-serif;
}
.square {
border:5px solid #0099ff;
height: 80px;
width: 80px;
margin-left: 20px;
border-radius: 30%;
}
.circle {
border:5px solid #0099ff;
border-radius: 100%;
height: 80px;
width: 80px;
margin-left: 20px;
}
.Pservice {
color: #0099ff;
text-align: center;
position: relative;
top: 12px;
}
#service {
display: flex;
flex-direction: row;
position: relative;
bottom: 1710px;
right: 440px;
}
#position3 {
position: relative;
bottom: 70px;
right: 157px;
}
#form {
position: relative;
bottom: 1830px;
right: 593px;
}
input {
border-radius: 6px;
}
input:nth-child(1)
{
width: 250px;
height: 20px;
margin-left: 10px;
}
input:nth-child(2)
{
width: 250px;
height: 20px;
}
#textarea {
width: 520px;
height: 250px;
margin-bottom: 10px;
}
#submit {
background-color: #0099ff;
color: white;
height: 50px;
width: 120px;
position: relative;
right: 200px;
bottom: 10px;
cursor: pointer;
}
#FirstWhite{
width: 750px;
height: 320px;
background-color: white;
margin: 0 auto;
position: relative;
bottom: 460px;
z-index: -1;
margin-bottom: 5px;
}
#AboutWhite {
width: 180px;
height: 650px;
background-color: white;
position: relative;
bottom: 1113px;
right: 385px;
z-index: -1;
}
#ServiceWhite {
width: 555px;
height: 165px;
background-color: white;
z-index: -1;
position: relative;
bottom: 1855px;
right: 580px;
}
#FooterWhite {
width: 555px;
height: 463px;
background-color: white;
z-index: -1;
position: relative;
bottom: 2292px;
right: 580px;
}
#media screen and (max-width:768px)
{
#img-main {
width: 100vw;
height: 150px;
}
#img-below {
width: 30vw;
height: 30vh;
margin-bottom: 10px;
}
h1, h2 {
font-size: 7vw;
position: relative;
bottom: 100px;
margin: 0 auto;
font-family: 'M PLUS Rounded 1c', sans-serif;
}
#flex-mobile1 {
display: flex;
flex-direction: row;
position: relative;
top: 70px;
right: 120px;
margin-top: 10px;
}
#flex-mobile2 {
display: flex;
flex-direction: row;
position: relative;
top: 150px;
left: 133px;
margin-top: 10px;
}
#FirstWhite{
width: 100vw;
height: 500px;
background-color: white;
display: block;
margin: 0 auto;
position: relative;
bottom: 490px;
z-index: -1;
margin-bottom: 5px;
}
#AboutWhite {
width: 100vw;
height: 300px;
background-color: white;
position: relative;
right: 0px;
bottom: 588px;
}
article {
position: relative;
right: 0px;
width: 85vw;
margin-right: 10px;
height: 100px;
}
#ServiceWhite
{
position: relative;
bottom: 650px;
right: 0px;
width: 100vw;
}
#service
{
position: relative;
bottom: 500px;
right: -120px;
}
#FooterWhite
{
position: relative;
bottom: 1080px;
right: 0px;
width: 100vw;
}
#form {
position: relative;
right: 0px;
bottom: 620px;
margin-right: 15px;
}
#inside-form {
position: relative;
right: 40px;
}
}
Link to Codepen
Hope this code helps you to build on top it. As of now the media query is set for 600px, you may change it to your desired break point.
* {
margin: 0;
padding: 0;
}
html {
font-size: 10px;
}
body {
background-color: #f0f0f0;
}
.container {
max-width: 800px;
margin: auto;
}
header {
position: relative;
}
.header-img {
width: 100%;
}
.rounded-img {
position: absolute;
height: 140px;
width: 140px;
border-radius: 50%;
border: 2px solid #fff;
overflow: hidden;
left: 50%;
transform: translate(-50%);
bottom: -60px;
}
.rounded-img img {
width: 100%;
height: 100%;
}
h1,
h2 {
font-family: "M PLUS Rounded 1c", sans-serif;
text-align: center;
}
.titles {
background-color: #fff;
padding-bottom: 40px;
}
h1 {
color: #0099ff;
font-size: 5rem;
padding: 60px 20px 0 20px;
}
h2 {
color: #808080;
font-size: 2.4rem;
}
.icons {
display: flex;
justify-content: center;
margin-top: 30px;
}
.icons a {
width: 40px;
height: 40px;
overflow: hidden;
margin: 0 15px;
border: 5px solid #0099ff;
padding: 10px;
border-radius: 50%;
}
.icons a img {
width: 100%;
height: 100%;
}
.content-section {
display: flex;
margin: 20px 0;
}
.article-right,
.article-left {
font-size: 1.6rem;
font-family: "M PLUS Rounded 1c", sans-serif;
}
.article-right {
order: 2;
width: 180px;
margin-left: auto;
text-align: right;
background-color: #fff;
padding: 20px;
box-sizing: border-box;
}
.article-left {
display: flex;
flex-direction: column;
flex: 1;
margin-right: 20px;
}
.article-left div {
text-align: right;
width: 100%;
background-color: #fff;
padding: 20px;
box-sizing: border-box;
}
.article-left .shapes-section {
margin-bottom: 30px;
}
.article-left .form-section {
margin-bottom: 50px;
}
#media screen and (max-width: 600px) {
.icons {
flex-wrap: wrap;
margin-top: 10px;
}
.icons a {
margin-top: 20px;
}
.content-section {
flex-direction: column;
}
.article-right,
.article-left,
.article-left .shapes-section,
.article-left .form-section {
text-align: center;
}
.article-left {
order: 2;
margin-right: 0;
}
.article-right {
margin-right: auto;
margin-bottom: 30px;
width: 100%;
}
}
<div class="container">
<header>
<img class="header-img" src="https://www.westsidemovement.com/wp-content/uploads/2018/03/Lets-Go-Scripture-800x200.jpg" alt="" />
<div class="rounded-img">
<img src="https://thumbor.forbes.com/thumbor/960x0/https%3A%2F%2Fblogs-images.forbes.com%2Frainerzitelmann%2Ffiles%2F2019%2F06%2FE0MG76-e1560965378507-1200x1270.jpg" alt="" />
</div>
</header>
<main>
<section class="titles">
<h1>אלברט איינשטיין</h1>
<h2>פיזיקאי תיאורטי</h2>
<div class="icons">
<a href="#">
<img src="https://cdn4.iconfinder.com/data/icons/social-media-logos-6/512/10-waze-512.png" alt="" />
</a>
<a href="#">
<img src="https://thebrightwork.com/wp-content/uploads/2014/04/facebook-icon-blue.png" alt="" />
</a>
<a href="#">
<img src="https://cdn2.iconfinder.com/data/icons/basic-thin-line-color/21/20-512.png" alt="" />
</a>
<a href="#">
<img src="https://www.trzcacak.rs/myfile/full/311-3111799_social-media-computer-icons-logo-blue-area-png.png" alt="" />
</a>
<a href="#">
<img src="https://img.icons8.com/ultraviolet/452/whatsapp.png" alt="" />
</a>
<a href="#">
<img src="https://cdn2.iconfinder.com/data/icons/thin-line-color-1/21/13-512.png" alt="" />
</a>
</div>
</section>
<section class="content-section">
<article class="article-right">
your right content
</article>
<article class="article-left">
<div class="shapes-section">
shapes content here
</div>
<div class="form-section">
form here
</div>
</article>
</section>
</main>
</div>

Can't center social media icons in the footer

I've been stuck on a problem for over 2 days and I need to ask for help. On Desktop browsers the icons are suppose to left align and in mobile browsers they are are suppose to center align.
Here is the site so far.
Inspect Site Here
I've created a website where the layout is comprised of stacked sections where height and width values of each section are defined using VH percentages to get a specific layout.
This is an example of how a section is defined in the CSS.
.content3 {
height: 100vh;
width: 100%;
display: table;
background: #FFFFFF url('../img/chair.png') no-repeat center center;
background-size: 60%;
}
Here is how I defined the footer's CSS.
.footer {
height: 40vh;
width: 100%;
background: #312D3B;
}
Here is the HTML for the .footer
<section class="footer">
<div class="Social">
<img class="icons" src="img/dribbble.svg">
<img class="icons2" src="img/twitter.svg">
<img class="icons3" src="img/instagram.svg">
</div>
Here is the CSS for the .Social class
.Social {
height: 100%;
float: left;
position: relative;
}
Here is the CSS for the .icons class
.icons {
bottom: 0;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
padding-left: 3.5em;
}
Here is the CSS for the .icons2 class
.icons2 {
bottom: 0;
left: 4.5em;
margin: auto;
position: absolute;
right: 0;
top: 0;
padding-left: 3.5em;
}
Here is the css for the icons3 class
.icons3 {
bottom: 0;
left: 9em;
margin: auto;
position: absolute;
right: 0;
top: 0;
padding-left: 3.5em;
}
Please help. This is my first question ever on this site.
You can use flexbox to help you with this issue, just replace style.css code with this one
CSS:
/* --------------------------------
Primary style
-------------------------------- */
*, *::after, *::before {
box-sizing: border-box;
}
body {
font-family: sans-serif;
line-height: 1;
margin: 0;
width: 100%;
height: 100%;
background: #1C1D21;
}
/* --------------------------------
Final project
-------------------------------- */
main {
position: relative;
z-index: 1;
height: 100vh;
overflow: hidden;
box-shadow: 0 0 50px #000;
transition: transform .5s;
}
.nav-open main {
transform: scale(.8);
}
.intro {
height: 90vh;
width: 100%;
display: table;
background: #FCC732 url('../img/WatchByMaz2.png') no-repeat center center;
background-size: 90%;
}
.content {
height: 100vh;
width: 100%;
display: table;
background: #FFFFFF url('../img/OculusConsumerByMaz.png') no-repeat center center;
background-size: 90%;
}
.content2 {
height: 100vh;
width: 100%;
display: table;
background: #FCC732 url('../img/speedingAppByMaz.png') no-repeat center center;
background-size: 90%;
}
.content3 {
height: 100vh;
width: 100%;
display: table;
background: #FFFFFF url('../img/chair.png') no-repeat center center;
background-size: 60%;
}
.footer {
height: 40vh;
width: 100%;
background: #312D3B;
}
.main-header {
position: relavtive;
background: #fff;
width: 100%;
top: 0;
}
section .center {
display: table-cell;
vertical-align: bottom;
text-align: center;
padding-bottom: 4em;
}
.btn {
-webkit-border-radius: 28;
-moz-border-radius: 28;
border-radius: 28px;
font-family: 'lulo_cleanone' , Arial, sans-serif;
color: #312D3B;
font-size: 16px;
padding: 10px 20px 10px 20px;
border: solid #312D3B 2px;
text-decoration: none;
}
.btn:hover {
text-decoration: none;
}
.logo {
position: fixed;
z-index: 1;
top: 43px;
left: 44px;
white-space: nowrap;
}
h1 {
font-family: 'lulo_cleanone_bold' , Arial, sans-serif;
display: table-cell;
vertical-align: middle;
text-align: center;
font-size: 90px;
color: #312D3B;
}
.nav-trigger {
position: fixed;
z-index: 4;
top: 40px;
right: 46px;
height: 44px;
width: 44px;
overflow: hidden;
color: transparent;
white-space: nowrap;
text-indent: 100%;
}
.nav-trigger span,
.nav-trigger span::before,
.nav-trigger span::after {
position: absolute;
height: 4px;
width: 40px;
background: #000000;
}
.nav-trigger span {
width: 29px;
}
.nav-trigger span {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transition: background .3s;
}
.nav-trigger span::before,
.nav-trigger span::after {
content: '';
top: 0;
left: 0;
transition: background .3s, transform .3s;
}
.nav-trigger span::before {
transform: translateY(-12px);
}
.nav-trigger span::after {
transform: translateY(12px);
}
.nav-trigger:hover span,
.nav-trigger:hover span::before,
.nav-trigger:hover span::after {
background: #000000;
}
.nav-open .nav-trigger span {
background: transparent;
}
.nav-open .nav-trigger span::before,
.nav-open .nav-trigger span::after {
background: #FFFFFF;
}
.nav-open .nav-trigger span::before {
transform: rotate(-45deg);
}
.nav-open .nav-trigger span::after {
transform: rotate(45deg);
}
.overlay {
position: fixed;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #1C1D21;
opacity: 0;
visibility: hidden;
transition: opacity .5s, visibility .5s;
}
.nav-open .overlay {
opacity: .6;
visibility: visible;
}
.nav-container {
position: fixed;
z-index: 3;
top: 0;
right: 0;
height: 100%;
width: 90%;
max-width: 460px;
padding: 2em 3.5em;
background: #312D3B;
overflow: hidden;
transform: translateZ(0);
transform: translateX(100%);
transition: transform .5s cubic-bezier(.07,.23,.34,1);
}
.nav-open .nav-container {
transform: translateX(0);
}
.nav-container h2 {
font-size: 12px;
font-family: 'lulo_cleanone' , Arial, sans-serif;
text-transform: uppercase;
color: #AAAAAA;
margin: 2.3em 0;
}
.nav {
list-style: none;
padding: 0;
}
.nav a {
display: block;
padding: .4em 0;
font-size: 30px;
font-weight: bold;
font-family: 'lulo_cleanone' , Arial, sans-serif;
text-decoration: none;
color: #FFFFFF;
transform: translateZ(0);
}
.nav-open .nav a {
animation: slide-in .4s .2s backwards;
}
.nav-open .nav li:nth-of-type(2) a {
animation-delay: .3s;
}
.nav-open .nav li:nth-of-type(3) a {
animation-delay: .4s;
}
.nav-open .nav li:nth-of-type(4) a {
animation-delay: .5s;
}
.nav-open .nav li:nth-of-type(5) a {
animation-delay: .6s;
}
#keyframes slide-in {
0% {
opacity: 0;
transform: translateX(80px);
}
100% {
opacity: 1;
transform: translateX(0);
}
}
.Social {
height: 100%;
display: flex;
justify-content: space-between;
width: 60%;
margin: 0 auto;
}
.icons {
}
.icons2 {
padding-left: 5.5em;
}
.icons3 {
padding-left: 6em;
}
.portfolio_nav {
height: 20vh;
width: 100%;
background: #312D3B;
}
.left_tab {
width: 49%;
height:100%;
background: #312D3B;
float: left;
position: relative;
}
.right_tab {
width: 49%;
height:100%;
background: #FFC600;
float: right;
position: relative;
}
.arrow {
max-height: 100%;
max-width: 100%;
width: auto;
height: auto;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.middle2 {
display: table-cell;
vertical-align: middle;
text-align: center;
}
#font-face {
font-family: 'lulo_cleanone_bold';
src: url('../yellow_design_studio_-_lulo_clean_one_bold-webfont.eot');
src: url('../yellow_design_studio_-_lulo_clean_one_bold-webfont.eot?#iefix') format('embedded-opentype'),
url('../yellow_design_studio_-_lulo_clean_one_bold-webfont.woff2') format('woff2'),
url('../yellow_design_studio_-_lulo_clean_one_bold-webfont.woff') format('woff'),
url('../yellow_design_studio_-_lulo_clean_one_bold-webfont.ttf') format('truetype'),
url('../yellow_design_studio_-_lulo_clean_one_bold-webfont.svg#lulo_cleanone_bold') format('svg');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'lulo_cleanone';
src: url('../yellow_design_studio_-_lulo_clean_one-webfont.eot');
src: url('../yellow_design_studio_-_lulo_clean_one-webfont.eot?#iefix') format('embedded-opentype'),
url('../yellow_design_studio_-_lulo_clean_one-webfont.woff2') format('woff2'),
url('../yellow_design_studio_-_lulo_clean_one-webfont.woff') format('woff'),
url('../yellow_design_studio_-_lulo_clean_one-webfont.ttf') format('truetype'),
url('../yellow_design_studio_-_lulo_clean_one-webfont.svg#lulo_cleanone') format('svg');
font-weight: normal;
font-style: normal;
}
/* --------------------------------
Desktop Media Queries
-------------------------------- */
#media screen and (min-width: 700px) {
.intro {
height: 100vh;
width: 100%;
display: table;
background: #FCC732 url('../img/WatchByMaz2.png') no-repeat center center;
background-size: 60%;
}
.content {
height: 100vh;
width: 100%;
display: table;
background: #F6F3F3 url('../img/OculusConsumerByMaz.png') no-repeat center center;
background-size: 60%;
}
.content2 {
height: 100vh;
width: 100%;
display: table;
background: #FCC732 url('../img/speedingAppByMaz.png') no-repeat center center;
background-size: 60%;
}
.content3 {
height: 100vh;
width: 100%;
display: table;
background: #FFFFFF url('../img/chair.png') center no-repeat;
background-size: 30%;
}
.Social {
display: flex;
justify-content: space-around;
height: 100%;
width: 30%;
margin: 0 auto;
}
.icons {
}
.icons2 {
padding-left: 3.5em;
}
.icons3 {
padding-left: 3.5em;
}
Here's a way to do it. Remove all absolute positions of .icon, .icon2and.icon3
Add this code on desktop :
.Social {
height: 100%;
float: left;
position: relative;
width: 100%;
text-align: left;
line-height: 40vh;
}
And this code on mobile with a media query for example :
#media (max-width: 640px) {
.Social {
text-align: center;
}
}
Change padding-left values for mobile like this :
.icons { padding-left: 1em; }
.icons2 { padding-left: 1em; }
.icons3 { padding-left: 1em; }
And keep padding-left values for desktop like this for example :
.icons { padding-left: 3.5em; }
.icons2 { padding-left: 3.5em; }
.icons3 { padding-left: 3.5em; }
I've tested it, it should works.

Z-index/layering issues

z-index doesn't seem to work for me. I've googled but can't seem to find the problem.
I want the .navigation css class to have a lower z-index than the css class .mobilenav and .mobilenavclosed so that these classes are layered above the other.
How can I accomplish this? I have tried both changing the position of the elements and changing the z- index but nothing seems to work.
Thank you!
This is my html
<div class="navWrapper" ng-controller="NavController">
<section class="navigation">
<div class="nav-container">
<button ng-click="openHamburger()" class="hamburger"><span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span></button>
<nav>
<ul class="nav-list" ng-repeat="navitem in navitems">
<li>
{{navitem.title}}
</li>
</ul>
</nav>
</div>
</section>
<div ng-class="{'mobilenav': isOpen, 'mobilenavclose': isClosed}">
<button ng-click="closeHamburger()" type="button" class="btn btn-default">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>
<div class="menuwrapper">
<button class="optionwrapper" ng-repeat="navitem in navitems">
<div class="navicon"></div>
<p>{{navitem.title}}<p>
</button>
</div>
</div>
This is my css
#keyframes active {
from {
border-bottom: 0px solid #5aaafa;
}
to {
border-bottom: 5px solid #5aaafa;
}
}
body,
html {
height: 100%;
margin: 0 auto;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
color: red;
}
.menuwrapper {
display: none;
}
button.btn.btn-default {
display: none;
}
.navWrapper {
height: 100vh;
width: 100vw;
}
.activeindicator {
width: 100%;
height: 10%;
background: #5aaafa;
}
.hamburger {
display: none;
}
.close {
display: none !important;
}
.navhidden {
display: none !important;
}
.navigation {
width: 100%;
height: 50px;
background: #333;
color: white;
position: relative;
z-index: 1;
}
.navigation a {
color: white;
text-decoration: none;
font-weight: 300;
}
.navigation a:hover {
color: #ffffff;
text-decoration: none;
border-bottom: 5px solid #5aaafa;
}
.nav-container {
margin: 0 auto;
padding: 0px 0px;
height: 100%;
position: relative;
}
nav {
display: inline-block;
font-size: .9em;
text-transform: uppercase;
font-weight: 700;
height: 100%;
position: absolute;
left: 23vw;
right: 23vw;
}
nav ul {
list-style: none;
text-align: left;
margin: 0;
padding: 0px;
height: 100%;
display: inline-block;
}
nav ul li {
float: none;
height: 100%;
}
nav ul li a {
display: block;
color: #a9a9a9;
padding: 0 20px;
background: #333;
height: 100%;
padding-top: 17px;
}
nav ul li a:hover,
nav ul li a:focus,
nav ul li a:active {
text-decoration: none;
color: #ffffff;
border-bottom: 5px solid #5aaafa;
animation: active;
animation-duration: 0.2s;
animation-timing-function: linear;
}
nav ul li > a:hover {
color: #ffffff;
}
nav ul li > a:not(:only-child):after {
padding-left: 4px;
content: ' ▾';
}
/* Mobile navigation */
.nav-mobile {
display: none;
position: absolute;
top: 0;
right: 0;
background: #262626;
height: 100%;
width: 70px;
}
#media only screen and (max-width: 1389px) {
nav {
left: 20vw;
right: 20vw;
}
}
#media only screen and (max-width: 1250px) {
nav {
left: 17vw;
right: 17vw;
}
}
#media only screen and (max-width: 1172px) {
nav {
left: 15vw;
right: 15vw;
}
}
#media only screen and (max-width: 1075px) {
nav {
left: 12vw;
right: 12vw;
}
}
//*IPAD VIEW
#media only screen and (max-width: 1000px) {
#keyframes openHamburger {
from {
width: 0vw;
}
to {
width: 40vw;
}
}
#keyframes closeHamburger {
from {
width: 40vw;
}
to {
width: 0vw;
}
}
nav ul,
nav li,
nav a {
display: none;
}
.hamburger {
display: inline;
background: none;
border: 0px;
height: 100%;
width: 8%;
padding: 0px;
}
.mobilenav.mobilenavclose {
height: 100vh;
background: #5aaafa;
width: 0vw;
margin: 0px;
animation: closeHamburger;
animation-duration: 0.7s;
position: relative;
z-index: 10;
}
.menuwrapper {
height: 32vw;
width: 33vw;
display: block;
position: inherit;
padding: 0px;
margin:0 auto;
top: 32vh;
}
.mobilenav {
height: 100vh;
background: #5aaafa;
width: 40vw;
margin: 0px;
animation: openHamburger;
animation-duration: 0.7s;
position: relative;
z-index: 10;
}
.navicon {
height: 7vw;
width: 7vw;
border: 2px solid white;
border-radius: 17vw;
margin: auto;
}
.optionwrapper {
text-align: center;
display: table-cell;
background: none;
border: none;
height: 11vw;
width: 11vw;
p {
color: white;
margin: 0px;
padding-top: 5%;
text-transform: uppercase;
font-size: 0.7em;
}
}
button.btn.btn-default {
display: inline !important;
background: none;
border: 0px;
top: 2%;
right: 5%;
position: absolute;
color: white;
font-size: 20px;
}
}
//*MOBILE VIEW
#media only screen and (max-width: 600px) {
#keyframes openHamburger {
from {
width: 0vw;
}
to {
width: 90vw;
}
}
#keyframes closeHamburger {
from {
width: 90vw;
}
to {
width: 0vw;
}
}
.mobilenav.mobilenavclose {
height: 100vh;
background: #5aaafa;
width: 0vw;
margin: 0px;
animation: closeHamburger;
animation-duration: 0.7s;
position: relative;
}
.mobilenav {
height: 100vh;
background: #5aaafa;
width: 90vw;
margin: 0px;
animation: openHamburger;
animation-duration: 0.7s;
position: relative;
}
.menuwrapper {
height: 78vw;
width: 72vw;
display: block;
position: inherit;
padding: 0px;
margin:0 auto;
top: 24vh;
}
.optionwrapper {
text-align: center;
display: table-cell;
background: none;
border: none;
height: 26vw;
width: 24vw;
p {
color: white;
margin: 0px;
padding-top: 10%;
text-transform: uppercase;
font-size: 0.8em;
}
}
.navicon {
height: 17vw;
width: 17vw;
border: 2px solid white;
border-radius: 17vw;
margin: auto;
}
}
if you want them to be layered, your bottom layer needs to be relative, but .mobilenav and .mobilenavclosed should be position: absolute; ? At least that's how the layering I do is done.
.mobilenav.mobilenavclose {
height: 100vh;
background: #5aaafa;
width: 0vw;
margin: 0px;
animation: closeHamburger;
animation-duration: 0.7s;
position: absolute;
z-index: 10;
}
as well .navigation shouldn't need a z index since it is too be the bottom?

Three extra pixels at the bottom of the page unaccounted for and not sure how to get rid of them?

I'm working on building a responsive website and I have run into an issue where, upon scrolling, there looks to be about two or three extra pixels at the bottom of the page beyond the content.
I'm not sure where they're coming from or how to get rid of them. They appear to be inside of the overall container but outside of the header and content blocks. I'm assuming it's some kind of margin issue?
Any assistance would be greatly appreciated!
JS Fiddle here: http://jsfiddle.net/BramVanroy/toxk8Lde/1/
HTML
<div id="container">
<div id="header">
<div id="headerLeft">
<div id="logo">
<img src="http://mbeach.me/arch/images/layout/logo_100.png" alt="MILES Arch Logo" id="miles_arch_logo" />
</div>
<div id="companyName">
<span id="miles_arch">MILES architecture group</span>
</div>
</div>
<div id="headerRight">
<div id="navMenu">
<img src="http://mbeach.me/arch/images/layout/menu_button.png" id="nav_menu_button" alt="menu_button" />
</div>
</div>
</div>
<div id="content">
<div id="slideshow">
<img src="http://mbeach.me/arch/images/layout/main_background.jpg" alt="" />
<div id="leftRight"></div>
<div id="buttons"></div>
</div>
</div>
</div>
CSS
html {
font-size: 100%;
}
body {
font-size: 1em;
background:;
}
#container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0px solid yellow;
}
#header {
width: 100%;
background: #fff;
border-bottom: 4px solid #ffa500;
display: inline-block;
}
#headerLeft {
display: inherit;
padding-bottom: 26px;
}
#logo {
display: inherit;
}
#miles_arch_logo {
position: relative;
top: 15px;
margin-left: 30px;
width: 100px;
height: 101px;
}
#companyName {
margin-left: 92px;
margin-right: 37px;
display: inherit;
font-size: 32px;
position: relative;
top: -20px;
color: #105697;
font-family: arial, sans-serif;
letter-spacing: .05em;
/* Below rescales font: first number is horizontal, second is vertical. */
transform: scale(1.2, .8);
/* W3C */
-webkit-transform: scale(1.2, .8);
/* Safari and Chrome */
-moz-transform: scale(1.2, .8);
/* Firefox */
-ms-transform: scale(1.2, .8);
/* IE 9 */
-o-transform: scale(1.2, .8);
/* Opera */
}
#headerRight {
display: inherit;
}
#navMenu {
width: 50px;
height: 41px;
position: absolute;
right: 44px;
top: 44px;
}
#nav_menu_button {
width: 50px;
height: 41px;
}
#content {
width: 100%;
max-width: 100%;
position: absolute;
top: 136px;
bottom: 0px;
border-bottom: 0px solid yellow;
margin: 0;
padding: 0;
}
#slideshow {
overflow: hidden;
}
#slideshow img {
width: 100%;
/*position: relative;
margin-top: -100px;*/
}
#leftRight {
position: absolute;
border: 0px solid red;
top: 0px;
width: 50px;
height: 50px;
}
#buttons {
position: absolute;
border: 0px solid red;
top: 0px;
left: 50px;
width: 50px;
height: 50px;
}
/* Resizes header info depending on screen size. */
#media (max-width: 1375px) {
/*#slideshow {
height: 531px;
overflow: hidden;
}
#slideshow img {
width: 100%;
border: 0px solid red;
}*/
}
#media (max-width: 800px) {
/*#slideshow {
height: 428px;
overflow: hidden;
}
#slideshow img {
width: 800px;
border: 0px solid red;
}*/
#companyName {
font-size: 22px;
margin-left: 52px;
margin-right: 37px;
}
#miles_arch_logo {
width: 70%;
height: 70%;
}
#nav_menu_button {
width: 80%;
height: 80%;
}
#content {
top: 126px;
}
}
#media (max-width: 700px) {
#companyName {
font-size: 18px;
margin-left: 22px;
margin-right: 37px;
top: -10px;
}
#miles_arch_logo {
width: 50%;
height: 50%;
}
#navMenu {
right: 20px;
top: 35px;
}
#nav_menu_button {
width: 60%;
height: 60%;
}
#content {
top: 99px;
}
}
#media (max-width: 500px) {
#companyName {
font-size: 16px;
margin-left: 22px;
margin-right: 37px;
top: 2px;
}
#miles_arch_logo {
width: 35%;
height: 35%;
}
#navMenu {
right: 8px;
top: 28px;
}
#nav_menu_button {
width: 55%;
height: 55%;
}
#content {
top: 79px;
}
}
#media (max-width: 425px) {
#companyName {
font-size: 12px;
margin-left: 2px;
margin-right: 37px;
top: 2px;
}
#miles_arch_logo {
width: 30%;
height: 30%;
}
#navMenu {
right: 5px;
top: 28px;
}
#nav_menu_button {
width: 50%;
height: 50%;
}
#content {
top: 72px;
}
}
Set your img's style to include display: block; or vertical-align: middle;
http://jsfiddle.net/85a6a52t/1/ (See very bottom of CSS panel)
#slideshow img { display: block; }
or
#slideshow img { vertical-align: middle; }
Reference to this good answer that explains issue