Safari percent width calculate wrong, 1px filcker from its parent - html

.projects {
position: relative;
background-color: black;
li {
position: relative;
width: calc(100% / 3);
display: inline-block;
cursor: pointer;
vertical-align: top;
overflow: hidden;
.bg-placeholder {
position: relative;
width: 100%;
img {
position: relative;
display: block;
width: 100%;
height: auto !important;
}
}
.bg {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
transition: transform cubic-bezier(0.165, 0.84, 0.44, 1) $time;
img {
position: relative;
display: block;
width: 100%;
height: auto !important;
}
}
.gradient {
position: absolute;
// width: 100%;
height: 80%;
left: -2px;
right: -1px;
top: auto;
bottom: -1px;
transform: translate3d(0,0,0);
transition: height cubic-bezier(0.165, 0.84, 0.44, 1) $time;
img {
height: 100%;
}
}
.content {
position: absolute;
width: 100%;
bottom: 0;
height: 35%;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.content-titles {
position: relative;
text-align: center;
width: 98%;
z-index: 2;
span {
font-size: 15px;
line-height: 1.4;
transition: opacity ease $time;
opacity: 0.7;
display: inline-block;
}
}
.content-title {
span {
font-family: "Gotham-Bold";
color: #fff;
text-transform: uppercase;
}
}
.content-sub-title {
margin-top: 3px;
span {
font-family: "Gotham-Book";
color: #d5a83d;
}
}
}
.cover-up {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
// opacity: 0;
// visibility: hidden;
// background-color: #000;
// transition: all ease $time;
display: flex;
justify-content: center;
align-items: center;
z-index: 3;
.text {
position: relative;
width: 100%;
text-align: center;
transform: translateY(100%);
opacity: 0;
visibility: hidden;
transition: all ease $time;
span {
display: inline-block;
font-family: "Gotham-Light";
color: #fff;
font-size: 24px;
text-transform: uppercase;
color: #d5a83d;
}
}
}
.desktop &:hover {
.bg {
transform: scale(1.12);
transition: all 0.3s ease;
}
.gradient {
height: 200%;
transition: all 0.3s ease;
}
.content{
.content-titles {
span {
opacity: 1;
}
}
}
.cover-up {
.text {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
}
}
}
}
Under some conditions, the projects dom looks like -1px offest to its parent. Why does this happen? Just occurs in safari, chrome & ff work just fine.
The red background-color in pic 1 is the color I gave to .projects 's parent dom. I found the red line mainly caused by translate3d(0,0,0) in .gradient, but if I remove this style, the hover effect will shake.
Please help me, Thanks!

Related

Issue regarding height of background video for Wide screens in Elementor

Hy, hope this finds you well.
I have a query regarding a video background for wide/big screens. The thing is it is working fine for all devices in the elementor settings also in actual but for widescreen LCD, it is not showing in a complete page rather some portion of below section is also coming.
Please advise as width and height is adjusted for the widescreen option of elementor.
Before disabled plugins and changed the theme for one another issue which was related to this video.
link of website: website link
Attached picture of the LCD model details + how it looks.
LCD Details
Appreciate if anyone know the solution, its done in elementor and on it, there is html code for buttons some images. Please see code if needed.
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
.hover {
position: relative;
display: inline-block;
}
.hover:before {
content: attr(data-hover);
visibility: hidden;
opacity: 1;
width: max-content;
background-color:;
color: #ffff;
justify-content: left;
transition: opacity 1s pop-up;
transition-delay: 0.5s;
display:inline-block;
width: 30em;
line-height: 1.2;
font-size:25px;
position: absolute;
z-index: 1;
left: -30px;
top: -350px;
}
.hover:hover:before {
opacity: 1;
visibility: visible;
display: inline-block;
}
.hover1 {
position: relative;
display: inline-block;
}
.hover1:before {
content: attr(data-hover);
visibility: hidden;
opacity: 1;
width: max-content;
background-color:;
color: #ffff;
justify-content: left;
transition: opacity 1s pop-up;
transition-delay: 0.5s;
display:inline-block;
width: 30em;
line-height: 1.2;
font-size:25px;
position: absolute;
z-index: 1;
left: -545px;
top: -350px;
}
.hover1:hover:before {
opacity: 1;
visibility: visible;
display: inline-block;
}
.hover2 {
position: relative;
display: inline-block;
}
.hover2:before {
content: attr(data-hover);
visibility: hidden;
opacity: 1;
width: max-content;
background-color:;
color: #ffff;
justify-content: left;
transition: opacity 1s pop-up;
transition-delay: 0.5s;
display:inline-block;
width: 30em;
line-height: 1.2;
font-size:25px;
position: absolute;
z-index: 1;
left:-1060px;
top: -350px;
}
.hover2:hover:before {
opacity: 1;
visibility: visible;
display: inline-block;
}
.image{
height: 800px;
width: 100%;
display:flex;
justify-content: space-evenly;
align-items: center;
font-weight: normal;
font-family:;
color: #cccccc;
font-size:28px;
text-decoration: none;
//display: grid;
place-content:center;
//justify-content:center;
background-size: cover;
background-position: center;
}
.training{
padding-top: 550px;
padding-right:470px;
padding-left: 20px;
}
.shop{
padding-top: 550px;
padding-left: 40px;
}
.services{
padding-top: 550px;
padding-right:500px;
}
.image>div {
display: inline-block;
width: 100px;
}
.image>div img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0;
z-index: 0;
display: inline-block;
}
.image>div span {
position: relative;
z-index: 1;
cursor: pointer;
display: inline-block;
}
.image>div span:hover+img {
opacity: 1;
//cursor: pointer;
display: inline-block;
}
}
#media only screen and (max-width:2400px) and (min-width:1199px) {
.image{
height: 800px;
width: 100%;
display:flex;
justify-content: space-evenly;
align-items: center;
font-weight: normal;
font-family:;
color: #cccccc;
font-size:28px;
text-decoration: none;
//display: grid;
place-content:center;
//justify-content:center;
background-size: cover;
background-position: center;
}
.training{
padding-top: 500px;
padding-right:420px;
padding-left: 20px;
}
.shop{
min-width:10px;
padding-top: 500px;
padding-left: 50px;
}
.services{
padding-top: 500px;
padding-right:450px;
}
.image>div {
display: inline-block;
width: 100px;
}
.image>div img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0;
z-index: 0;
display: inline-block;
}
.image>div span {
position: relative;
z-index: 1;
cursor: pointer;
display: inline-block;
}
.image>div span:hover+img {
opacity: 1;
//cursor: pointer;
display: inline-block;
}
}
#media only screen and (max-width:1366px) and (min-width:1170px) {
.hover {
position: relative;
display: inline-block;
}
.hover:before {
content: attr(data-hover);
visibility: hidden;
opacity: 1;
width: max-content;
background-color:;
color: #ffff;
justify-content: left;
transition: opacity 1s pop-up;
transition-delay: 0.5s;
display:inline-block;
width: 30em;
line-height: 1.2;
font-size:25px;
position: absolute;
z-index: 1;
left: -80px;
top: -350px;
}
.hover:hover:before {
opacity: 1;
visibility: visible;
display: inline-block;
}
.hover1 {
position: relative;
display: inline-block;
}
.hover1:before {
content: attr(data-hover);
visibility: hidden;
opacity: 1;
width: max-content;
background-color:;
color: #ffff;
justify-content: left;
transition: opacity 1s pop-up;
transition-delay: 0.5s;
display:inline-block;
width: 30em;
line-height: 1.2;
font-size:25px;
position: absolute;
z-index: 1;
left: -545px;
top: -350px;
}
.hover1:hover:before {
opacity: 1;
visibility: visible;
display: inline-block;
}
.hover2 {
position: relative;
display: inline-block;
}
.hover2:before {
content: attr(data-hover);
visibility: hidden;
opacity: 1;
width: max-content;
background-color:;
color: #ffff;
justify-content: left;
transition: opacity 1s pop-up;
transition-delay: 0.5s;
display:inline-block;
width: 30em;
line-height: 1.2;
font-size:25px;
position: absolute;
z-index: 1;
left: -1000px;
top: -350px;
}
.hover2:hover:before {
opacity: 1;
visibility: visible;
display: inline-block;
}
.image{
height: 800px;
width: 100%;
display:flex;
justify-content: space-evenly;
align-items: center;
font-weight: normal;
font-family:;
color: #cccc;
font-size:28px;
text-decoration: none;
//display: grid;
place-content:center;
//justify-content:center;
background-size: cover;
background-position: center;
}
.training{
padding-top: 500px;
padding-right:410px;
padding-left: 65px;
}
.shop{
padding-top: 500px;
padding-right:65px;
}
.services{
padding-top: 500px;
padding-right:400px;
padding-left: 0px;
}
.image>div {
display: inline-block;
width: 100px;
}
.image>div img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0;
z-index: 0;
display: inline-block;
}
.image>div span {
position: relative;
z-index: 1;
cursor: pointer;
display: inline-block;
}
.image>div span:hover+img {
opacity: 1;
display: inline-block;
}
}
#media only screen and (max-width:1200px) and (min-width:1000px) {
.image{
height: 800px;
width: 100%;
display:flex;
justify-content: space-evenly;
align-items: center;
font-weight: normal;
font-family:;
color: #cccc;
font-size:28px;
text-decoration: none;
//display: grid;
place-content:center;
//justify-content:center;
background-size: cover;
background-position: center;
}
.training{
padding-top: 500px;
padding-right: 350px;
padding-left: 160px;
}
.shop{
padding-top: 500px;
padding-left: 35px;
}
.services{
padding-top: 500px;
padding-right:220px;
}
.image>div {
display: inline-block;
width: 100px;
}
.image>div img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0;
z-index: 0;
display: inline-block;
}
.image>div span {
position: relative;
z-index: 1;
cursor: pointer;
display: inline-block;
}
.image>div span:hover+img {
opacity: 1;
//cursor: pointer;
display: inline-block;
}
}
#media only screen and (max-width:1024px) and (min-width:768px) {
.image{
height: 800px;
width: 100%;
display:flex;
justify-content: space-evenly;
align-items: center;
font-weight: normal;
font-family:;
color: #cccccc;
font-size:28px;
text-decoration: none;
//display: grid;
place-content:center;
//justify-content:center;
background-size: cover;
background-position: center;
}
.training{
padding-top: 500px;
padding-right:260px;
padding-left: 105px;
}
.shop{
padding-top: 500px;
padding-left: 40px;
padding-right:130px;
}
.services{
padding-top: 500px;
padding-right:200px;
padding-left: 62px;
}
.image>div {
display: inline-block;
width: 100px;
}
.image>div img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0;
z-index: 0;
display: inline-block;
}
.image>div span {
position: relative;
z-index: 1;
cursor: pointer;
display: inline-block;
}
.image>div span:hover+img {
opacity: 1;
//cursor: pointer;
display: inline-block;
}
}
#media only screen and (max-width:767px) {
.image{
height: 800px;
width: 100%;
display:flex;
justify-content: space-evenly;
align-items: center;
font-weight: normal;
font-family:;
color: #cccccc;
font-size:25px;
text-decoration: none;
//display: grid;
place-content:center;
//justify-content:center;
background-size: cover;
background-position: center;
}
.training{
padding-top: 500px;
padding-right:120px;
padding-left: 0px;
}
.shop{
padding-top: 500px;
padding-left: 20px;
padding-right:05px;
}
.services{
padding-top: 500px;
padding-right:130px;
padding-left:0px;
margin: 0px;
}
.image>div {
display: inline-block;
width: 100px;
}
.image>div img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0;
z-index: 0;
display: inline-block;
}
.image>div span {
position: relative;
z-index: 1;
cursor: pointer;
display: inline-block;
}
.image>div span:hover+img {
opacity: 1;
//cursor: pointer;
display: inline-block;
}
}
</style>
</head>
<body>
<div class="image">
<div class="services">
<span class="hover" data-hover="We provide different services including Inspection, Fabric Maintenance & Installation, Mechanical, Access Solutions and Design & Installation "
onclick="window.location='https://beta.edgerope.com/services'">Services</span>
<img src="http://beta.edgerope.com/wp-content/uploads/2022/08/2-1120x800.jpg">
</div>
<div class="training">
<div>
</div>
<span class="hover1" data-hover="We provide IRATA and SPRAT Training" onclick="window.location='beta.edgerope.com/courses'">Training</span>
<img src="http://beta.edgerope.com/wp-content/uploads/2022/08/1-1-1536x864.jpg"> </div>
<div class="shop">
<span class="hover2" data-hover="We are selling different rope access products through Salla Platform" onclick="window.location='beta.edgerope.com/shop'">Shop</span>
<img src="http://beta.edgerope.com/wp-content/uploads/2022/08/1-1-1536x864.jpg"> </div>
</div>
</body>
</html>
Use media query like this:
#media screen and (max-aspect-ratio: 16/9) {
}

I'm trying to change the button hover color to transparent but isn't working

Here is the code below. I'm trying to change the button hover color to transparent. the div class = "button_container" while the button class = "btn"
I changed the color initially but it isn't working and I would appreciate any help that can be thrown my way.
Thank you in advance
I know this is mostly code I'm posting but I can't figure it out. I believe the knowledgeable community here on Stack overflow can help me figure it out. Cheers
.button_container {
position: absolute;
left: 0;
right: 0;
top: 30%;
}
.description, .link {
font-family: 'Amatic SC', cursive;
text-align: center;
}
.description {
font-size: 35px;
}
.btn {
line-height: 1;
border-radius: 5px;
align-items: center;
align-content: space-around;
z-index: 2;
height: 48px;
width: 200px;
border: none;
display: flex;
text-align: -webkit-left;
cursor: pointer;
text-transform: uppercase;
outline: none;
overflow: hidden;
position: relative;
color: #ffffff;
font-weight: 600;
font-size: 0.95rem;
background-image: linear-gradient(90deg,#70AECD 0%,#022350 100%);
padding: 1rem 1rem 1rem 3.99rem;
margin: -10px auto;
box-shadow: 0 5px 15px rgb(0 0 0 / 20%);
flex-direction: row;
flex-wrap: wrap;
align-content: center;
}
.btn span {
position: relative;
z-index: 1;
}
.btn:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 2.25rem;
height: 100%;
border-right: 1px solid #000000;
padding:119px;
}
.btn:before {
content: url(https://.com/wp-content/uploads/2021/06/.png);
position: absolute;
top: 0%;
left: -11.25rem;
width: 0rem;
height: 73%;
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.btn:after {
content: "";
position: absolute;
left: 0;
top: 0;
height: 858%;
width:347%;
background: #ffae25;
-webkit-transition: all .5s ease-in-out;
transition: all .5s ease-in-out;
-webkit-transform: translateX(-98%) translateY(-25%) rotate(37deg);
transform: translateX(-98%) translateY(-25%) rotate(47deg);
}
.btn:hover:after {
-webkit-transform: translateX(-9%) translateY(-25%) rotate(47deg);
transform: translateX(-9%) translateY(-25%) rotate(45deg);
}
.link {
font-size: 20px;
margin-top: 30px;
}
.link a {
color: #000;
font-size: 25px;
}
I change your opacity so you can make it as transparent. I am not sure if this is what you mean or you want the text to change the color?? If so i change it. I dont have your html so this is what I came up with Let me know.
.button_container {
position: absolute;
left: 0;
right: 0;
top: 30%;
}
.description, .link {
font-family: 'Amatic SC', cursive;
text-align: center;
}
.description {
font-size: 35px;
}
.btn {
line-height: 1;
border-radius: 5px;
align-items: center;
align-content: space-around;
z-index: 2;
height: 48px;
width: 200px;
border: none;
display: flex;
text-align: -webkit-left;
cursor: pointer;
text-transform: uppercase;
outline: none;
overflow: hidden;
position: relative;
color: #ffffff;
font-weight: 600;
font-size: 0.95rem;
background-image: linear-gradient(90deg,#70AECD 0%,#022350 100%);
padding: 1rem 1rem 1rem 3.99rem;
margin: -10px auto;
box-shadow: 0 5px 15px rgb(0 0 0 / 20%);
flex-direction: row;
flex-wrap: wrap;
align-content: center;
}
.btn span {
position: relative;
z-index: 1;
}
.btn:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 2.25rem;
height: 100%;
border-right: 1px solid #000000;
padding:119px;
}
.btn:before {
content: url(https://.com/wp-content/uploads/2021/06/.png);
position: absolute;
top: 0%;
left: -11.25rem;
width: 0rem;
height: 73%;
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.btn:after {
content: "";
position: absolute;
left: 0;
top: 0;
height: 858%;
width:347%;
background: #ffae25;
opacity:.3;
-webkit-transition: all .5s ease-in-out;
transition: all .5s ease-in-out;
-webkit-transform: translateX(-98%) translateY(-25%) rotate(37deg);
transform: translateX(-98%) translateY(-25%) rotate(47deg);
}
.btn:hover:after {
-webkit-transform: translateX(-9%) translateY(-25%) rotate(47deg);
transform: translateX(-9%) translateY(-25%) rotate(45deg);
z-index:1;
}
.link {
font-size: 20px;
margin-top: 30px;
}
.btn > a {
color: #000;
font-size: 25px;
}
<div class="button_cotainer">
<div class="btn">button1</div>
<div class="btn">button2</div>
<div class="btn">button3</div>
<div class="btn">button4</div>
<div>

Page doesn't scroll and text doesn't appear below the header, in the body

can someone please help me. I'm facing an issue where my page doesn't scroll down and the paragraphs don't appear in the body but on the header of my page. I have removed all unnecessary overflow elements from the CSS but that did not do anything.
https://codepen.io/arvindr2002/pen/oNzzMQb.
Thank you.
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: 'Raleway', sans-serif;
background-color: black;
}
header {
background-image: url(../images/Game.jpg);
height: 100%;
width: 100%;
-webkit-background-size: cover;
background-size: cover;
background-position: right-side;
position: fixed;
}
nav {
position: fixed;
z-index: 10;
left: 0;
right: 0;
top: 0;
padding: 0 5%;
height: 45px;
background-color: #E94B3CFF;
}
nav .logo {
float: left;
width: 40%;
height: 100%;
display: flex;
align-items: center;
font-size: 24px;
color: #fff;
}
nav a:hover {
border-top: 2px red;
border-bottom: 4px solid white;
padding: 6px 0;
}
nav .nav-area {
float: right;
padding: 0;
margin: 0;
width: 60%;
height: 100%;
display: flex;
justify-content: space-around;
align-items: center;
}
nav .nav-area li {
list-style: none;
}
nav .nav-area a {
display: block;
padding: 1em;
font-size: 16px;
font-weight: bold;
color: #fff;
text-decoration: none;
}
#nav-toggle {
position: absolute;
top: -100px;
}
nav .icon-burger {
display: none;
position: absolute;
right: 5%;
top: 50%;
transform: translateY(-50%);
}
nav .icon-burger .line {
width: 30px;
height: 5px;
background-color: #fff;
margin: 5px;
border-radius: 3px;
transition: all .3s ease-in-out;
}
#media screen and (max-width: 768px) {
nav .logo {
float: none;
width: auto;
justify-content: center;
}
nav .nav-area { /* transforing toggle-bar */
float: none;
position: fixed;
z-index: 9;
left: 0;
right: 0;
top: 100px;
bottom: 100%;
width: auto;
height: auto;
flex-direction: column;
justify-content: space-evenly;
background-color: rgba(0,0,0,.8);
box-sizing: border-box;
transition: all .5s ease-in-out;
}
nav .a {
font-size: 20px;
}
nav :checked ~ .nav-area {
bottom: 0;
}
nav .icon-burger {
display: block;
}
nav :checked ~ .icon-burger .line:nth-child(1) {
transform: translateY(10px) rotate(225deg);
}
nav :checked ~ .icon-burger .line:nth-child(3) {
transform: translateY(-10px) rotate(-225deg);
}
nav :checked ~ .icon-burger .line:nth-child(2) {
opacity: 0;
}
}
.welcome-text {
position: fixed;
width: 600px;
height: 300px;
margin: 25% 30%;
text-align: center;
}
.welcome-text h1 {
text-align: center;
color: #fff;
text-transform: uppercase;
font-size: 60px;
}
.welcome-text h1 span {
color: #E94B3CFF;
}
.glow{
position: relative;
display: inline-block;
padding: 20px 15px;
margin: 10px 1;
color: #E94B3CFF;
text-decoration: none;
text-transform: uppercase;
transition: 0.5s;
letter-spacing: 4px;
overflow: hidden;
margin-right: 20px;
}
.glow:hover{
background: #E94B3CFF;
color: #050801;
box-shadow: 0 0 5px #E94B3CFF,
0 0 25px #E94B3CFF,
0 0 50px #E94B3CFF,
0 0 200px #E94B3CFF;
-webkit-box-reflect:below 1px linear-gradient(transparent, #0005);
}
.glow span{
position: absolute;
display: block;
}
.glow span:nth-child(1){
top: 0;
left: 0;
width: 100%;
height: 2px;
background: linear-gradient(90deg,transparent,#E94B3CFF);
animation: animate1 1s linear infinite;
}
#keyframes animate1{
0%{
left: -100%;
}
50%,100%{
left: 100%;
}
}
.glow span:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,#E94B3CFF);
animation: animate2 1s linear infinite;
animation-delay: 0.25s;
}
#keyframes animate2{
0%{
top: -100%;
}
50%,100%{
top: 100%;
}
}
.glow span:nth-child(3){
bottom: 0;
right: 0;
width: 100%;
height: 2px;
background: linear-gradient(270deg,transparent,#E94B3CFF);
animation: animate3 1s linear infinite;
animation-delay: 0.50s;
}
#keyframes animate3{
0%{
right: -100%;
}
50%,100%{
right: 100%;
}
}
.glow span:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg,transparent,#E94B3CFF);
animation: animate4 1s linear infinite;
animation-delay: 0.75s;
}
#keyframes animate4{
0%{
bottom: -100%;
}
50%,100%{
bottom: 100%;
}
}/*resposive*/

CSS won't transition opacity

What I want to do in the bigger picture is delay the popup for a few seconds after page-load using pure CSS. I've decided the best way to do that is by transitioning the opacity, then using transition-delay to delay it for a few seconds.
My problem is that transition doesn't work and won't delay the popup (nor the dark overlay).
Why is that and how can I fix it?
If it's not possible, is there another way to delay the popup for a few seconds?
hr {
clear: both;
margin-top: 15px;
margin-bottom: 15px;
border: 0;
border-top: 1px solid #aaaaaa;
}
#css-only-modals {
position: fixed;
pointer-events: none;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 10000000;
text-align: center;
white-space: nowrap;
height: 100%;
}
#css-only-modals:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -0.25em;
}
.css-only-modal-check {
pointer-events: auto;
}
.css-only-modal-check:checked~.css-only-modal {
/* FOR TRANSITION */
opacity: 1;
transition: opacity 3s;
/*NOT WORKING */
pointer-events: auto;
}
.css-only-modal {
width: 360px;
background: #FFF;
z-index: 1;
display: inline-block;
position: relative;
pointer-events: auto;
padding: 25px;
text-align: right;
border-radius: 4px;
white-space: normal;
display: inline-block;
vertical-align: middle;
opacity: 0;
pointer-events: none;
}
.css-only-modal h2 {
text-align: left;
color: #1A1A1C;
}
.css-only-modal p {
text-align: left;
}
.css-only-modal-close {
position: absolute;
top: 25px;
right: 25px;
}
.css-only-modal-check {
display: none;
}
.css-only-modal-check:checked~#screen-shade {
/* FOR TRANSITION */
opacity: 0.5;
transition: opacity 3s;
/*NOT WORKING */
pointer-events: auto;
}
#screen-shade {
opacity: 0;
background: #000;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
pointer-events: none;
transition: opacity 0.8s;
}
.stripe>.container>p,
.stripe>.container>ul {
text-align: left;
padding: 35px;
margin: 0;
}
#nav-spacer {
display: block;
height: 50px;
}
.stripe {
width: 100%;
text-align: center;
overflow: hidden;
}
.css-only-modal-btn {
background-color: #BD2C15;
color: white;
padding: 8px 18px;
letter-spacing: 0.5px;
}
.css-only-modal-btn:hover {
color: #BD2C15;
background-color: transparent;
outline: 2px solid #BD2C15;
transition: background-color 0.5s, color 0.5s;
}
<label for="modal1">
<div id="css-only-modals">
<input id="modal1" class="css-only-modal-check" type="checkbox" checked/>
<div class="css-only-modal">
<label for="modal1" class="css-only-modal-close"><i class="fa fa-times fa-2x"></i></label>
<h2>Referral</h2>
<hr />
<p>Refer a customer, email me and receive a 25% commission. <br> Earn up to 1225$ from a single referral!</p>
<hr />
<label for="modal1" class="css-only-modal-btn">NICE!</label>
</div>
<div id="screen-shade"></div>
</div>
</label>
In the CSS I created two comments "FOR TRANSITION". They mark the opacities I want to transition.
Put the transition on your initial element.
.css-only-modal-check {
pointer-events: auto;
}
.css-only-modal-check ~ .css-only-modal {
/* FOR TRANSITION */
transition: opacity 3s;
}
.css-only-modal-check:checked ~ .css-only-modal {
opacity: 1;
pointer-events: auto;
}
.css-only-modal {
width: 360px;
background: #FFF;
z-index: 1;
display: inline-block;
position: relative;
pointer-events: auto;
padding: 25px;
text-align: right;
border-radius: 4px;
white-space: normal;
display: inline-block;
vertical-align: middle;
opacity: 0;
pointer-events: none;
}
Also make sure to keep the transition always set, only change the opacity to 0 on ~checked.
Also transition-delay must be underneath the transition.
here is the full modified code
.css-only-modal-check {
pointer-events: auto;
}
.css-only-modal-check ~ .css-only-modal {
/* FOR TRANSITION */
transition: opacity 3s;
}
.css-only-modal-check:checked ~ .css-only-modal {
opacity: 0;
pointer-events: auto;
}
.css-only-modal {
width: 360px;
background: #FFF;
z-index: 1;
display: inline-block;
position: relative;
pointer-events: auto;
padding: 25px;
text-align: right;
border-radius: 4px;
white-space: normal;
display: inline-block;
vertical-align: middle;
/*opacity: 0;*/
transition: opacity 3s;
transition-delay:2s;
pointer-events: none;
}

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.