Hello I am fairly new to styling and have seen related questions but have not been able to extract my own solution from their answers. I am hoping someone can clue me into why this carousel works as intended on Chrome and Edge but not Firefox. I have tried duplicating nearly all the CSS declarations with -moz prefix without any noticeable impact.
Less importantly, I was only able to animate the nav buttons by targeting their IDs. Originally targeting their class,n-th child had no effect,
This fiddle demonstrates the undesired behavior: https://jsfiddle.net/gharyiey/8h1tLxgo/42/
If you apply color to the "carousel_snapper" div, you can see that it actually is getting animated, but the adjacent div containing the img is not.
Any help is greatly appreciated...
CSS
#keyframes indicate {
0%, 70% {
background-color: #fff;
}
70%, 100% {
background-color: #333;
}
}
#keyframes tonext {
75% {
left: 0%;
}
95% {
left: 100%;
}
98% {
left: 100%;
}
99% {
left: 0%;
}
}
#keyframes tostart {
75% {
left: 0%;
}
95% {
left: -300%;
}
98% {
left: -300%;
}
99% {
left: 0%;
}
}
#keyframes snap {
96% {
scroll-snap-align: center;
}
97% {
scroll-snap-align: none;
}
99% {
scroll-snap-align: none;
}
100% {
scroll-snap-align: center;
}
}
* {
box-sizing: border-box;
scrollbar-color: transparent transparent; /*thumb and track color*/
scrollbar-width: 0px;
}
*::-webkit-scrollbar {
width: 0;
}
*::-webkit-scrollbar-track {
background: transparent;
}
*::-webkit-scrollbar-thumb {
background: transparent;
border: none;
}
.carousel > ol, li {
list-style: none;
margin: 0;
padding: 0;
}
.carousel {
position: relative;
filter: drop-shadow(0 0 10px #0003);
perspective: 100px;
}
.carousel__viewport {
position: relative;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
overflow-x: scroll;
scroll-behavior: smooth;
scroll-snap-type: x mandatory;
}
.carousel__slide {
position: relative;
flex: 0 0 100%;
}
.carousel__slide::before {
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%, -40%, 70px);
color: #fff;
font-size: 2em;
}
.carousel__snapper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
scroll-snap-align: center;
/*background-color: greenyellow; <-- UNCOMMENT TO SEE ANIMATED DIV*/
}
#media (hover: hover) {
.carousel__snapper {
animation-name: snap, tonext;
animation-timing-function: ease;
animation-duration: 4100ms;
animation-iteration-count: infinite;
}
#nav1 {
animation: indicate 12300ms infinite -1000ms;
}
#nav2 {
animation: indicate 12300ms infinite 3100ms;
}
#nav3 {
animation: indicate 12300ms infinite 7200ms;
}
.carousel__slide:last-child .carousel__snapper {
animation-name: tostart, snap;
}
}
.carousel:hover .carousel__snapper,
.carousel:focus-within .carousel__snapper {
animation-play-state: paused;
}
.carousel:hover #nav1,
.carousel:focus-within #nav1 {
animation-play-state: paused;
}
.carousel:hover #nav2,
.carousel:focus-within #nav2 {
animation-play-state: paused;
}
.carousel:hover #nav3,
.carousel:focus-within #nav3 {
animation-play-state: paused;
}
.carousel__navigation {
position: absolute;
right: 0;
bottom: 0;
left: 0;
text-align: center;
}
.carousel__navigation-list,
.carousel__navigation-item {
display: inline-block;
}
.carousel__navigation-button {
display: inline-block;
width: 1.5rem;
height: 1.5rem;
background-color: #333;
background-clip: content-box;
border: 0.25rem solid transparent;
border-radius: 50%;
font-size: 0;
transition: transform 0.1s;
}
.dummy_img {
height:290px;
width:640px;
display: block;
margin-left: auto;
margin-right: auto;
}
.img_text {
text-align: center;
vertical-align: middle;
line-height: 290px;
}
HTML
<h1 style="text-align:center">PURE CSS/HTML CAROUSEL WITH ANIMATED NAV</h1>
<section class="carousel" aria-label="Gallery">
<ol class="carousel__viewport">
<li id="carousel__slide1" tabindex="0" class="carousel__slide">
<div class="carousel__snapper"></div>
<div class="dummy_img">
<h1 class="img_text">IMAGE 1</h1>
<!--<a href="">
<img src="img1.jpg" alt="alt_tag_1">
</a>-->
</div>
</li>
<li id="carousel__slide2" tabindex="0" class="carousel__slide">
<div class="carousel__snapper"></div>
<div class="dummy_img">
<h1 class="img_text">IMAGE 2</h1>
<!--<a href="">
<img src="img2.jpg" alt="alt_tag_2">
</a>-->
</div>
</li>
<li id="carousel__slide3" tabindex="0" class="carousel__slide">
<div class="carousel__snapper"></div>
<div class="dummy_img">
<h1 class="img_text">IMAGE 3</h1>
<!--<a href="">
<img src="img3.jpg" alt="alt_tag_3">
</a>-->
</div>
</li>
</ol>
<aside class="carousel__navigation">
<ol class="carousel__navigation-list">
<li class="carousel__navigation-item">
Go to slide 1
</li>
<li class="carousel__navigation-item">
Go to slide 2
</li>
<li class="carousel__navigation-item">
Go to slide 3
</li>
</ol>
</aside>
</section>
Related
I'm new to HTML and CSS. I just made a carousel slide using HTML and CSS. And I want to insert text in the corners of this slide. I couldn't do that because whatever I tried didn't work. I'm also trying to redirect to a different page when clicking on this slide.
I'am sorry my English btw. I hope I could explain what I mean.
CSS and HTML of my slide:
.tech-slideshow {
height: 190px;
max-width: 2600px;
margin: 0;
position: relative;
overflow: hidden;
transform: translate3d(0, 0, 0);
}
.tech-slideshow > div {
height: 200px;
width: 2526px;
background: url(https://resmim.net/cdn/2022/10/22/OybOx.jpg);
position: absolute;
top: 0;
left: 0;
height: 100%;
transform: translate3d(0, 0, 0);
}
.tech-slideshow .mover-1 {
animation: moveSlideshow 40s linear infinite;
}
#keyframes moveSlideshow {
50% {
transform: translateX(-40%);
}
}
<div class="tech-slideshow">
<div class="mover-1"></div>
</div>
Here's a possible solution with absolute positioning:
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.tech-slideshow {
height: 190px;
max-width: 2600px;
position: relative;
overflow: hidden;
}
.tech-slideshow__link {
display: block;
width: 100%;
height: 100%;
}
.mover-1 {
width: 2526px;
background: url(https://resmim.net/cdn/2022/10/22/OybOx.jpg);
height: 100%;
animation: moveSlideshow 40s linear infinite;
}
.mover-1-text {
position: absolute;
padding: 0.5em 2em;
color: #fff;
background-color: #000;
font-size: 1.5rem;
}
.mover-1-text1 {
left: 10px;
top: 10px;
}
.mover-1-text2 {
left: 10px;
bottom: 10px;
}
.mover-1-text3 {
right: 10px;
bottom: 10px;
}
#keyframes moveSlideshow {
50% {
transform: translateX(-40%);
}
}
<div class="tech-slideshow">
<a href="#" class="tech-slideshow__link" target="_blank">
<div class="mover-1"></div>
<p class="mover-1-text mover-1-text1">Text</p>
<p class="mover-1-text mover-1-text2">Text</p>
<p class="mover-1-text mover-1-text3">Text</p>
</a>
</div>
I've been playing around with using #keyframes to build a simple mega menu. I'm only learning but would this be an accepted way to show/hide the <nav> items for use in the real world? More than anything I wanted the transistion in/out effect but kept triggering the menu by hovering over the opaque object.
https://codepen.io/ngcook1985/pen/bGvqRRp
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.header {
height: 80px;
width: 100%;
background-color: rgb(84, 161, 228);
position: relative;
}
.menu {
position: absolute;
height: 120px;
width: 100%;
top: -180px;
background-color: rgb(74, 234, 181);
opacity: 0;
animation: hide .3s linear;
}
.header:hover .menu {
animation: show .3s linear;
opacity: 1;
top: 80px;
}
#keyframes show {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#keyframes hide {
0% {
opacity: 1;
top: 80px;
}
100% {
top: 80px;
opacity: 0;
}
}
<body>
<div class="header">
<div class="menu"></div>
</div>
</body>
Recently, I've been building a website for a keyboard-enthusiast business. On the home page, I have category buttons that animate when hovered. However, it abruptly ends once the mouse cursor is no longer on it. To combat this problem, I decided to use the psuedo-elements: :hover::after. I created a new animation called afterbuttonslide with the following code and assigned it to the psuedo-element like this:
#keyframes afterbuttonhoverslide {
0% {
padding: 0 25 0 0;
}
100% {
padding: 0;
}
}
.homepagecategories:hover::after {
animation: 0.2s ease-out 0s 1 afterbuttonhoverslide;
animation-fill-mode: forwards;
}
This however doesn't execute the animation as intended. After reading other Stack Overflow answers such as Deepak Yadev's and an article from GeeksforGeeks, I tried adding content: ""; and temporaily removing my psuedo-element :hover with underwhelming results. Perhaps the psuedo-element :after is simply ineffective on anything but anchors? I'm willing to take any answer that can provide me with the same result I intended before.
Rest of my code:
<head>
<title>HotDogKeyboards</title>
<link rel="icon" href="https://drive.google.com/uc?export=download&id=1Ka7ylovILyZSEcIUTituT9f_uzFdKfCl">
</head>
<body style="margin: 0; padding: 0; background-color: #2e3440;">
<!-- This style element is temporary to display CSS on the same script as my HTMl code. -->
<style>
/* Imported Fonts */
#font-face {
font-family: Roboto;
src: url(https://drive.google.com/uc?export=download&id=1PopP9idetRz1ULFNGXyP6kraMyV4bt5F);
}
#font-face {
font-family: Poppins;
src: url(https://drive.google.com/uc?export=download&id=16AyE8WbBCW13Z-Ixbmctio3TKuajAhwt);
}
#font-face {
font-family: indie-flower;
src: url(https://drive.google.com/uc?export=download&id=1NosWGJF7-PsfwCHZI_es8anZhO_bz8wu);
}
#font-face {
font-family: red-seven;
src: url(https://drive.google.com/uc?export=download&id=1Xs4IIqDBGc_lCYFBLeC6DPhohsJPBeTp);
}
#font-face {
font-family: good-times;
src: url(https://drive.google.com/uc?export=download&id=1nj8_G-SMT-2Bqh8kVdRJ0w7D8DXzmomC);
}
/* Property specific classes*/
h1.temporarywait {
font-family: Roboto;
}
p.temporarywait {
font-family: Poppins;
}
img.mainicon {
width: 13%;
}
a.headerbuttons {
padding: 10px 15px 10px 15px;
font-size: 27px;
font-family: indie-flower;
text-decoration: none;
color: black;
}
a:visited.headerbuttons {
color: black;
}
a:active.headerbuttons {
color: white;
background-color: #FFFF9F;
margin: 0;
}
a:hover.headerbuttons {
background-color: #FFF017;
color: white;
}
a:hover.button {
background-color: #EFCC00;
}
a:visited.button {
color: black;
}
p.categorytop {
font-family: good-times;
color: white;
font-size: 3vw;
text-align: center;
}
/* Classes */
.header {
background-color: #EAAA00;
padding: 25px;
margin: 0;
position: fixed;
z-index: 99;
width: 100%;
/*TEMPORARY, REMOVE WHEN NECESSARY*/
opacity: 0%;
}
.headerbuttons {
display: inline-block;
padding: 2.5px 4px 2.5px 4px;
margin: 0;
}
.headerlinkwrapper {
background-color: #EFCC00;
width: 100%;
position: fixed;
margin: 0 0 0 -25;
z-index: 99;
}
.featuredproducttext {
position: absolute;
top: 50%;
left: 30px;
color: white;
font-family: red-seven;
font-size: 2.2vw;
}
.featuredproductbutton {
position: absolute;
top: 75%;
left: 30px;
}
.button {
background-color:#EAAA00;
text-align: center;
text-decoration: none;
padding: 1.5vw 2vw;
font-size: 2vw;
font-family: Poppins;
color: black;
}
.featuredproductinfo {
position: absolute;
top: 60%;
left: 30px;
color: white;
font-size: 1.3vw;
font-family: red-seven;
}
.categorytop {
padding: 0.5em 0 0.5em 0;
background-color: #434c5e;
margin: 4px 0 0 0;
}
.categorytext {
color: #e5e9f0;
font-family: good-times;
font-size: 1.7vw;
position: absolute;
top: 23%;
left: 5px;
}
/*Class Animations*/
.featuredproducttext {
animation: 1.7s ease-out 0s 1 slidein;
}
.featuredproductinfo {
animation: 1s ease-out 0s 1 slidein;
animation-fill-mode: both;
animation-delay: 1.7s;
}
.featuredproductbutton {
animation: 1.5s ease-out 0s 1 slideappearance;
animation-fill-mode: both;
animation-delay: 2.9s;
}
.headershowanimation {
animation: 1s ease-out 0s 1 headershow;
}
.headerhideanimation {
animation: 1s ease-out 0s 1 headershow;
}
.homepagecategories {
width: 20%;
height: 17.6vw;
transform: skew(-20deg);
display: inline-block;
margin: -5;
overflow: hidden;
}
/*Homepage Category Images*/
.category1 {
background-image: url("https://drive.google.com/uc?export=download&id=1EmJgZ15Se4XmJUSD4asHA2fu-vhYphvx");
}
.category2 {
background-image: url("https://drive.google.com/uc?export=download&id=1iyEtTFXeYrKK-shG16nixjcX7W54vqv1");
}
.category3 {
background-image: url("https://drive.google.com/uc?export=download&id=1iPUbZjhhx7Nu_8tPoRniJGjPcj6zJAI6");
}
.category4 {
background-image: url("https://drive.google.com/uc?export=download&id=1LAIxyXDgEhromN7v5loednVbX97UtlIB");
}
.category5 {
background-image: url("https://drive.google.com/uc?export=download&id=1Yxm4BQx36QbMNrq4Wox7ox5gR0u0yjfu");
}
/*End of Category Images*/
.homepagecategorycontainer {
overflow: hidden;
background-color: #333333;
position: relative;
}
.homepagecategorycontent {
transform: skew(20deg);
background-repeat: no-repeat;
background-size: cover;
width: 33vw;
height: 33vw;
position: absolute;
}
.homepagecategories:hover::after {
animation: 0.2s ease-out 0s 1 afterbuttonhoverslide;
animation-fill-mode: forwards;
}
.homepagecategories:hover {
animation: 0.5s ease-out 0s 1 buttonhoverslide;
animation-fill-mode: forwards;
}
.homepagecategories:hover .homepagecategorycontent {
animation: 0.5s ease-out 0s 1 buttonimageslide;
animation-fill-mode: forwards;
}
.homepagecategories:hover .categorytext {
animation: 0.7s ease-out 0s 1 slightright;
animation-fill-mode: forwards;
}
/* IDs */
#featuredproduct {
position: relative;
text-align: center;
}
/*Animations*/
#keyframes slidein {
0% {
transform: translateX(-100%);
opacity: 0%;
}
100% {
transform: translateX(-20);
opacity: 100%;
}
}
#keyframes slideappearance {
0% {
opacity: 0%;
top: 77%;
}
100%{
opacity: 100%;
top: 75%;
}
}
#keyframes headerhide {
0% {
top: 120px;
}
100% {
top: -100%
}
}
#keyframes headershow {
0% {
top: -100%;
}
100%{
top: 120px;
}
}
#keyframes buttonhoverslide {
0% {
padding: 0;
}
100% {
padding: 0 25 0 0;
}
}
#keyframes buttonimageslide {
0% {
background-position: 0 0;
}
100% {
background-position: -30 0;
}
}
#keyframes afterbuttonhoverslide {
0% {
padding: 0 25 0 0;
}
100% {
padding: 0;
}
}
#keyframes floatandappear {
0% {
opacity: 0%;
}
100% {
opacity: 100;
transform: translateX();
}
}
#keyframes slightright {
0% {
top: 23%;
left: 5px;
}
100% {
top: 23%;
left: 10px;
}
}
</style>
<!-- Fixed Header -->
<header>
<div class="header" id="header">
<div>
<center>
<img class="mainicon" src="https://drive.google.com/uc?export=download&id=1blJIRZ7SCMqXqTPJ0REXchspxgWJ5k7t">
</center>
</div>
<center>
<div class="headerlinkwrapper">
<div class="headerbuttons">
<a class="headerbuttons" href="#">Test</a>
</div>
<div class="headerbuttons">
<a class="headerbuttons" href="#">Test</a>
</div><div class="headerbuttons">
<a class="headerbuttons" href="#">Test</a>
</div>
</div>
</center>
</div>
</div>
</header>
<!--Featured Product Header -->
<div id="toppage">
</div>
<!-- Featured Product Section -->
<div id="featuredproduct">
<img src="https://drive.google.com/uc?export=download&id=1_b_5r5jFu92jUrou8p9Y4GgTfaABG2Jq" width="100%">
<!-- Product Name -->
<div class="featuredproducttext">
Placeholder Keyboard
</div>
<!-- Brief Product Info -->
<div class="featuredproductinfo">
Awesome, and even more awesome.
</div>
<div class="featuredproductbutton">
Learn More
</div>
</div>
</div>
<!-- Categories -->
<div class="categorytop">
<p class="categorytop">Categories</p>
</div>
<center>
<div class="homepagecategorycontainer">
<a href="#">
<div class="homepagecategories">
<div class="homepagecategorycontent category1">
</div>
<div class="categorytext">
Switches
</div>
</div>
</a>
<a href="#1">
<div class="homepagecategories">
<div class="homepagecategorycontent category2">
</div>
<div class="categorytext">
Keycaps
</div>
</div>
</a>
<a href="#2">
<div class="homepagecategories">
<div class="homepagecategorycontent category3">
</div>
<div class="categorytext">
Keyboards
</div>
</div>
</a>
<a href="#3">
<div class="homepagecategories">
<div class="homepagecategorycontent category4">
</div>
<div class="categorytext">
Group Buy
</div>
</div>
</a>
<a href="#4">
<div class="homepagecategories">
<div class="homepagecategorycontent category5">
</div>
<div class="categorytext">
Misc.
</div>
</div>
</a>
</div>
</center>
</body>
You can use :hover css event on elements. ::after is not what you need.
You don't need an animation to do this.. you can set transition: xx to your button (not :hover) and when the button is hovered you can change the padding or resize it.
And remember that padding: 0 25 0 0; is not correct, you have to specify 25 what. For example 25px.
Here an example:
button {
transition: all .2s linear;
}
button:hover {
padding: 0 25px 0 0;
}
<button>Hello</button>
Hi I have a problem trying to getting the animation at the left hand side of the button when user mouse over the button. One of the example that explain as below:
HTML:
<div class="block">
<div class="normal">
<span>Follow me...</span>
</div>
<a target="_BLANK" class="hover" href="http://twitter.com/benoitboucart" title="My twitter profile">
on Twitter
</a>
CSS:
/**
* CSS3 balancing hover effect
* Read the tutorial here: http://webbb.be/blog/little-css3-3d-hover-effects/
*/
body {background: #f06;background: linear-gradient(45deg, #f06, yellow);min-height: 100%;}
.block {
width: 150px; color: #fff; margin: 30px auto; text-transform: uppercase; text-align: center; font-family: Helvetica;
position: relative;
perspective: 350;
}
.block .normal {
background: gray; padding: 15px; cursor: pointer;
position:relative; z-index:2;
}
.block .hover {
background: #00aced; margin-top:-48px; padding: 15px; display: block; color: #fff; text-decoration: none;
position: relative; z-index:1;
transition: all 250ms ease;
}
.block:hover .normal {
background: #0084b4;
}
.block:hover .hover {
margin-right: 0;
transform-origin: top;
/*
animation-name: balance;
animation-duration: 1.5s;
animation-timing-function: ease-in-out;
animation-delay: 110ms;
animation-iteration-count: 1;
animation-direction: alternate;
*/
animation: balance 1.5s ease-in-out 110ms 1 alternate;
}
#keyframes balance {
0% { margin-top: 0; }
15% { margin-top: 0; transform: rotateX(-50deg); }
30% { margin-top: 0; transform: rotateX(50deg); }
45% { margin-top: 0; transform: rotateX(-30deg); }
60% { margin-top: 0; transform: rotateX(30deg); }
75% { margin-top: 0; transform: rotateX(-30deg); }
100% { margin-top: 0; transform: rotateX(0deg);}
}
https://jsfiddle.net/9dwk8vzg/
Original link:http://dabblet.com/gist/5559193
But for this example is at the bottom instated of at the left hand side of the button, I tried using margin-right and padding-left still unable to get the mouse over appeal div tag to be on the right hand side, may I know what do I miss to get the div tag to appeal on the right hand side/
/**
* CSS3 balancing hover effect
* Read the tutorial here: http://webbb.be/blog/little-css3-3d-hover-effects/
*/
body {background: #f06;background: linear-gradient(45deg, #f06, yellow);min-height: 100%;}
.block {
width: 150px; color: #fff; margin: 30px auto; text-transform: uppercase; text-align: center; font-family: Helvetica;
position: relative;
perspective: 350;
}
.block .normal {
width: 100%;
background: gray; padding: 15px; cursor: pointer;
position:relative; z-index:2;
}
.block .hover {
width: 100%;
background: #00aced;
padding: 15px;
display: block;
position:absolute;
color: #fff;
text-decoration: none;
z-index:1;
transition: all 250ms ease;
right: -30px;
top: 0;
}
.block:hover .normal {
background: #0084b4;
}
.block:hover .hover {
right: 100%;
transform-origin: top;
/*
animation-name: balance;
animation-duration: 1.5s;
animation-timing-function: ease-in-out;
animation-delay: 110ms;
animation-iteration-count: 1;
animation-direction: alternate;
*/
animation: balance 1.5s ease-in-out 110ms 1 alternate;
}
#keyframes balance {
15% { width: 95%; }
30% { width: 105%; }
45% { width: 97%; }
60% { width: 103%; }
75% { width: 97%; }
100% { width: 100%; }
}
<div class="block">
<div class="normal">
<span>Follow me...</span>
</div>
<a target="_BLANK" class="hover" href="http://twitter.com/benoitboucart" title="My twitter profile">
on Twitter
</a>
</div>
I've got a CSS slider, But I can't get it to auto slide.
I've got 4 divs of backgrounds that I'm trying to get to auto slide as a splash page for a website.
I don't know if the issue is my data cycle or am I better of finding a JS tutorial for this?
Can anyone help, please
.content { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 100}
body
{
background: #3B242D;
font-family: 'Raleway', sans-serif;
}
html,body{height:100%; overflow: hidden}
.cycle-slideshow{position:fixed !important;top:0;bottom:0;left:0;right:0; z-index: 0}
#keyframes slidy {
0% { left: 0%; }
20% { left: 0%; }
25% { left: -100%; }
45% { left: -100%; }
50% { left: -200%; }
70% { left: -200%; }
75% { left: -300%; }
95% { left: -300%; }
100% { left: -400%; }
}
div#slider figure {
position: relative;
width: 500%;
margin: 0;
left: 0;
text-align: left;
font-size: 0;
animation: 5s slidy infinite;
}
<!-- language: lang-html -->
<div id="slider">
<figure>
<div class="cycle-slideshow">
<div class="item"
style="background-image:url(https://thetaguk.com/site/wp-content/uploads/2017/11/splash-page-1.png)">
<div class="overlay"></div>
</div>
<div class="item"
style="background-image:url(https://thetaguk.com/site/wp-content/uploads/2017/11/splash-page-2.png)">
<div class="overlay"></div>
</div>
<div class="item"
style="background-image:url(https://thetaguk.com/site/wp-content/uploads/2017/11/splash-page-3.png)">
<div class="overlay"></div>
</div>
<div class="item"
style="background-image:url(https://thetaguk.com/site/wp-content/uploads/2017/11/splash-page-4.png)">
<div class="overlay"></div>
</div>
</div>
</figure>
</div>
I have Had abit more of a play with it and Think this is a better code, However it still does'nt work.
Have I possibly got too many DIV's going on?
I dont know if its the Div Im trying to set to slide or the Keyframes?
Thank you
Ive solved the issue.
Instead of putting background in the HTML I did it in the css and then did an animation per slide.
<div class='slider'>
<div class='slide1'><div class="text"><h2>TRUSTED ASIAN GUIDE</h2>
<h1>ASIAN WEDDING
DIRECTORY</h1>
<h2>
BRINGING YOU
OUR ADVANCED SEARCH TOOLBAR</h2></div>
</div>
<div class='slide2'><div class="text"><h2>TRUSTED ASIAN GUIDE</h2>
<h1>ASIAN WEDDING
DIRECTORY</h1>
<h2>
USE #TAGS TO FIND YOUR PERFECT
IMAGES FROM OUR SUPPLIERS</h2></div>
</div>
<div class='slide3'><div class="text"><h2>TRUSTED ASIAN GUIDE</h2>
<h1>ASIAN WEDDING
DIRECTORY</h1>
<h2>
WE’RE DOING THINGS IN A
DIFFERENT WAY</h2></div>
</div>
<div class='slide4'><div class="text"><h2>TRUSTED ASIAN GUIDE</h2>
<h1>ASIAN WEDDING
DIRECTORY</h1>
<h2>
WITH THE SUPPORT FROM THE
BIGGEST NAMES OUT THERE</h2></div>
</div>
</div>
<div class="content">
<img class="logo-img" src="https://thetaguk.com/site/wp-content/uploads/2017/11/splash-page-logo.png" alt="" >
<div class="btnContainer">
ENTER
</div>
</div>
body
{
background: #3B242D;
font-family: 'Raleway', sans-serif;
}
h1{color:#fff; border-bottom:3px solid; border-top:3px solid;}
h2{color:#fff;}
.text{height:50%; width:30%; float:right;padding-right:5%;}
.slider{position:fixed !important;top:0;bottom:0;left:0;right:0; z-index: 0; }
.slider{background-position:inherit;background-size:cover;width:100%;height:100%; z-index: 1;}
.slide1,.slide2,.slide3,.slide4,.slide5 {
position: absolute;
width: 100%;
height: 100%;
}
.slide1 {
background: url(https://thetaguk.com/site/wp-content/uploads/2017/11/splash-page-1-image.png)no-repeat center;
background-size: cover;
animation:fade 12s infinite;
-webkit-animation:fade 12s infinite;
}
.slide2 {
background: url(https://thetaguk.com/site/wp-content/uploads/2017/11/splash-page-2-image.png)no-repeat center;
background-size: cover;
animation:fade2 12s infinite;
-webkit-animation:fade2 12s infinite;
}
.slide3 {
background: url(https://thetaguk.com/site/wp-content/uploads/2017/11/splash-page-3-image.png)no-repeat center;
background-size: cover;
animation:fade3 12s infinite;
-webkit-animation:fade3 12s infinite;
}
.slide4 {
background: url(https://thetaguk.com/site/wp-content/uploads/2017/11/spashpage-4-image-1.png)no-repeat center;
background-size: cover;
animation:fade3 12s infinite;
-webkit-animation:fade3 12s infinite;
}
#keyframes fade
{
0% {opacity:1}
33.333% { opacity: 0}
66.666% { opacity: 0}
100% { opacity: 1}
}
#keyframes fade2
{
0% {opacity:0}
33.333% { opacity: 1}
66.666% { opacity: 0 }
100% { opacity: 0}
}
#keyframes fade3
{
0% {opacity:0}
33.333% { opacity: 0}
66.666% { opacity: 1}
100% { opacity: 0}
}
.btnContainer { margin-top: 20px; }
.btn {
display: inline-block;
background: #3B242D;
color: white;
padding: 10px 20px;
text-decoration: none;
}
.logo-img{
width: 320px;
}
.content { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 100}
#media only screen and (max-width: 503px) {
.tag{ padding-left:30px; background-size:contain; }
.tag span{ font-size: 21px; }
.logo-img{
width: 160px;
}
h1 {
color: #fff;
border-bottom: 1px solid;
border-top: 1px solid;
font-size: 18px;
}
h2{color:#fff; font-size:14px;}
.text{height:50%; width:80%; }
}
#media only screen and (max-width: 768px){
.cycle-slideshow .item{
background-position:center center;
}
.tag.img-1 {
bottom: auto;
right: 10%;
top: 70px;
}
.logo-img {
width: 100px;
}
}
See the PEN here
https://codepen.io/Chazlie/pen/MOmdEX