How to separate overlays on a hexagon grid - html

I have a hexagon grid and have added an overlay but the issue is all of hexagons show the same overlay. Want to see about how to separate so each hexagon will have its own overlay and I can place different words/phrases on each one. My end goal is for each hexagon to not only say something different but link to different pages. Thank ya!!!
CSS:
img {
width: 100%;
height: auto;
display: block;
object-fit: cover;
}
.hexagon-gallery {
margin: auto;
margin-top: 50px;
max-width: 1000px;
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-auto-rows: 200px;
grid-gap: 14px;
padding-bottom: 50px;
}
.hex {
display: flex;
position: relative;
width: 240px;
height: 265px;
background-color: #424242;
-webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.hex:first-child {
grid-row-start: 1;
grid-column: 2 / span 2;
}
.hex:nth-child(2) {
grid-row-start: 1;
grid-column: 4 / span 2;
}
.hex:nth-child(3) {
grid-row-start: 1;
grid-column: 6 / span 2;
}
.hex:nth-child(4) {
grid-row-start: 2;
grid-column: 1 / span 2;
}
.hex:nth-child(5) {
grid-row-start: 2;
grid-column: 3 / span 2;
}
.hex:nth-child(6) {
grid-row-start: 2;
grid-column: 5 / span 2;
}
.hex:nth-child(7) {
grid-row-start: 2;
grid-column: 7 / span 2;
}
.hex:nth-child(8) {
grid-row-start: 3;
grid-column: 2 / span 2;
}
.hex:nth-child(9) {
grid-row-start: 3;
grid-column: 4 / span 2;
}
.hex:nth-child(10) {
grid-row-start: 3;
grid-column: 6 / span 2;
}
.container {
position: absolute;
width: 50%;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;
background-color: #008CBA;
}
.container:hover .overlay {
opacity: 1;
}
.text {
color: white;
font-size: 20px;
position: absolute;
top: 15%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
}
a:link, a:visited {
background-color: #f44336;
color: white;
padding: 15px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
position: absolute;
right: 60px;
top:130px;
}
a:hover, a:active {
background-color: red;
}
<div class="container">
<section class="hexagon-gallery">
<div class="hex"><img src="img/hiw.png"> <div class="overlay">
<div class="text">Hello World</div>
This is a link
</div></div>
<div class="hex"><img src="img/wc.png"></div> <div class="overlay">
<div class="text">Hello World</div>
This is a link
</div>
<div class="hex"><img src="img/sc.png"> <div class="overlay">
<div class="text">Hello World</div>
This is a link
</div></div>
<div class="hex"><img src="img/ew.png"> <div class="overlay">
<div class="text">Hello World</div>
This is a link
</div></div>
</section>
</div>

Related

Margin-bottom not working for image elements

The divs inside mini_projects_11 are all attached to each other, but I am providing margin-bottom. I've tried attaching margin to 'a' and also assigning 'a' display:block, but still isn't working.
style.scss
#mini_projects {
background-color: rgba(0,0,0,.85);
grid-column: 1/4;
grid-row: 1/7;
height: 100vh;
width: 100vw;
&1{
display: grid;
height: 100vh;
width: 100vw;
grid-template-columns: 20% 60% 20%;
grid-template-rows: 20% 60% 20%;
background-color: $mainDOrange;
clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
&1{
grid-column: 2/3;
grid-row: 2/3;
overflow-x: hidden;
overflow-y: scroll;
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: 40% 40%;
grid-auto-rows: 40%;
div{
justify-self: center;
height: 100%;
width: 90%;
margin-bottom:5rem; (NOT WORKING)
text-align: center;
a{
text-decoration: none;
display: block;
img{
width: 100%;
height: 100%;
border-radius: 50%;
}
span{
z-index: 1;
display: block;
color: white;
font-size: 2.5rem;
transform: translate(0rem,5rem);
}
}
}
}
}
}
#mini_projects {
background-color: rgba(0, 0, 0, .85);
grid-column: 0.25;
grid-row: 0.1428571429;
height: 100vh;
width: 100vw;
}
#mini_projects1 {
display: grid;
height: 100vh;
width: 100vw;
grid-template-columns: 20% 60% 20%;
grid-template-rows: 20% 60% 20%;
background-color: orange;
clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}
#mini_projects11 {
grid-column: 0.6666666667;
grid-row: 0.6666666667;
overflow-x: hidden;
overflow-y: scroll;
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: 40% 40%;
grid-auto-rows: 40%;
}
#mini_projects11 div {
justify-self: center;
height: 100%;
width: 90%;
margin-bottom: 5rem;
/* (NOT WORKING) */
text-align: center;
}
#mini_projects11 div a {
text-decoration: none;
display: block;
}
#mini_projects11 div a img {
width: 100%;
height: 100%;
border-radius: 50%;
}
#mini_projects11 div a span {
z-index: 1;
display: block;
color: white;
font-size: 2.5rem;
transform: translate(0rem, 5rem);
}
<div id="mini_projects">
<div id="mini_projects1">
<div id="mini_projects11">
<div id="omnifood"><span>Omnifood</span><img src="img/omnifood.png" alt=""></div>
<div id="natours"><span>Natours</span><img src="img/natours.png" alt=""></div>
<div id="nexter"><span>Nexter</span><img src="img/nexter.png" alt=""></div>
<div id="trillo"><span>Trillo</span><img src="img/trillo.png" alt=""></div>
</div>
</div>
nevermind, I just fixed it with row-gap in #main_projects_11 .
row-gap:2rem;

box-shadow inset leaves dark edge on a div

I've got a div on which i want to put an inset shadow to achieve a smooth Transition to the Background. The Problem is, that the outer most ring of Pixels is not affected by the shadow. If you take the border radius out the Problem is still present, but affects only the Bottom side of the rectangle.
https://codepen.io/FrozenYoghurt/pen/WNrjVRx
The divs do not contain anything.
.homescreen2 {
display: grid;
grid-gap: 0px;
width: 100%;
height: 100vh;
padding-top: 110px;
background-color: rgba(250,250,250,1.00);
grid-template-columns: repeat(31, 1fr);
grid-template-rows: repeat(17, 1fr);
}
.hometransition {
transition: 0.7s;
box-shadow: 0 0 15px 15px rgba(250,250,250,1) inset;
}
.homeimg01 {
grid-column-start: 10;
grid-column-end: 15;
grid-row-start: 3;
grid-row-end: 7;
background-size: cover;
background-position: center;
background-color: rgba(250,250,250,1.00);
background-image: url("https://i.postimg.cc/Jz7MbMJ3/cat-1361649-639x426.jpg");
border-radius: 50%;
}
.homeimg01:hover {
transform: scale(1.1);
border-radius: 35%;
}
.hometext01 {
grid-column-start: 10;
grid-column-end: 15;
grid-row-start: 8;
grid-row-end: 9;
}
.homeimg02 {
grid-column-start: 21;
grid-column-end: 26;
grid-row-start: 4;
grid-row-end: 8;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/bvsPBgms/cat-1362565-639x647.jpg");
border-radius: 50%;
}
.homeimg02:hover {
transform: scale(1.1);
}
.homeimg03 {
grid-column-start: 2;
grid-column-end: 7;
grid-row-start: 6;
grid-row-end: 10;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/j2rrCbt7/cat-1378752-640x480.jpg");
border-radius: 50%;
}
.homeimg03:hover {
transform: scale(1.1);
}
.homeimg04 {
grid-column-start: 26;
grid-column-end: 31;
grid-row-start: 9;
grid-row-end: 13;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/wvNp6v8z/cat-1393633-639x461.jpg");
border-radius: 50%;
}
.homeimg04:hover {
transform: scale(1.1);
}
.homeimg05 {
grid-column-start: 7;
grid-column-end: 12;
grid-row-start: 11;
grid-row-end: 15;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/wBZz8NrF/cat-1395746-640x480.jpg");
border-radius: 50%;
}
.homeimg05:hover {
transform: scale(1.1);
}
.homeimg06 {
grid-column-start: 18;
grid-column-end: 23;
grid-row-start: 12;
grid-row-end: 16;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/zGd576Ss/cat-1404368-640x512.jpg");
border-radius: 50%;
}
.homeimg06:hover {
transform: scale(1.1);
}
<div class="homescreen2">
<div class="homeimg01 hometransition"></div>
<div class="homeimg02 hometransition"></div>
<div class="homeimg03 hometransition"></div>
<div class="homeimg04 hometransition"></div>
<div class="homeimg05 hometransition"></div>
<div class="homeimg06 hometransition"></div>
</div>
I searched stackoverflows archives for a solution, but didn't find anything. I tried to cover it up with a border with the same Color as the Background and shadow, but it actually made it worse.
If you don’t want to alter the markup or use a pseudo element, you can add background-clip: content-box; padding: 1px; to hide the edge.
.homescreen2 {
display: grid;
grid-gap: 0px;
width: 100%;
height: 100vh;
padding-top: 110px;
background-color: rgba(250, 250, 250, 1.00);
grid-template-columns: repeat(31, 1fr);
grid-template-rows: repeat(17, 1fr);
}
.hometransition {
transition: 0.7s;
box-shadow: 0 0 15px 15px #fff inset;
}
.homeimg01 {
grid-column-start: 10;
grid-column-end: 15;
grid-row-start: 3;
grid-row-end: 7;
background-size: cover;
background-position: center;
background-color: rgba(250, 250, 250, 1.00);
background-image: url("https://i.postimg.cc/Jz7MbMJ3/cat-1361649-639x426.jpg");
background-clip: content-box;
padding: 1px;
}
<div class="homescreen2">
<div class="homeimg01 hometransition"></div>
</div>
Replace it with a pseudo element:
.homescreen2 {
display: grid;
grid-gap: 0px;
width: 100%;
height: 100vh;
padding-top: 110px;
background-color: rgba(250, 250, 250, 1.00);
grid-template-columns: repeat(31, 1fr);
grid-template-rows: repeat(17, 1fr);
}
.hometransition {
transition: 0.7s;
position:relative;
}
.hometransition::before {
content:"";
position:absolute;
top:-1px;
left:-1px;
right:-1px;
bottom:-1px;
border-radius:inherit;
box-shadow: 0 0 16px 16px rgba(250, 250, 250, 1) inset;
}
.homeimg01 {
grid-column-start: 10;
grid-column-end: 15;
grid-row-start: 3;
grid-row-end: 7;
background-size: cover;
background-position: center;
background-color: rgba(250, 250, 250, 1.00);
background-image: url("https://i.postimg.cc/Jz7MbMJ3/cat-1361649-639x426.jpg");
border-radius: 50%;
}
.homeimg01:hover {
transform: scale(1.1);
border-radius: 35%;
}
.hometext01 {
grid-column-start: 10;
grid-column-end: 15;
grid-row-start: 8;
grid-row-end: 9;
}
.homeimg02 {
grid-column-start: 21;
grid-column-end: 26;
grid-row-start: 4;
grid-row-end: 8;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/bvsPBgms/cat-1362565-639x647.jpg");
border-radius: 50%;
}
.homeimg02:hover {
transform: scale(1.1);
}
.homeimg03 {
grid-column-start: 2;
grid-column-end: 7;
grid-row-start: 6;
grid-row-end: 10;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/j2rrCbt7/cat-1378752-640x480.jpg");
border-radius: 50%;
}
.homeimg03:hover {
transform: scale(1.1);
}
.homeimg04 {
grid-column-start: 26;
grid-column-end: 31;
grid-row-start: 9;
grid-row-end: 13;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/wvNp6v8z/cat-1393633-639x461.jpg");
border-radius: 50%;
}
.homeimg04:hover {
transform: scale(1.1);
}
.homeimg05 {
grid-column-start: 7;
grid-column-end: 12;
grid-row-start: 11;
grid-row-end: 15;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/wBZz8NrF/cat-1395746-640x480.jpg");
border-radius: 50%;
}
.homeimg05:hover {
transform: scale(1.1);
}
.homeimg06 {
grid-column-start: 18;
grid-column-end: 23;
grid-row-start: 12;
grid-row-end: 16;
background-size: cover;
background-position: center;
background-color: black;
background-image: url("https://i.postimg.cc/zGd576Ss/cat-1404368-640x512.jpg");
border-radius: 50%;
}
.homeimg06:hover {
transform: scale(1.1);
}
<div class="homescreen2">
<div class="homeimg01 hometransition"></div>
<div class="homeimg02 hometransition"></div>
<div class="homeimg03 hometransition"></div>
<div class="homeimg04 hometransition"></div>
<div class="homeimg05 hometransition"></div>
<div class="homeimg06 hometransition"></div>
</div>
Really odd that it does that. Here's a workaround:
.homescreen2 {
display: grid;
grid-gap: 0px;
width: 100%;
height: 100vh;
background-color: rgba(250, 250, 250, 1.00);
grid-template-columns: repeat(31, 1fr);
grid-template-rows: repeat(17, 1fr);
}
.hometransition {
transition: 0.7s;
}
.homeimg01 {
grid-column-start: 2;
grid-column-end: 7;
grid-row-start: 2;
grid-row-end: 6;
background-size: cover;
background-position: center;
background-color: rgba(0, 0, 0, 1.00);
background-image: url("https://i.postimg.cc/Jz7MbMJ3/cat-1361649-639x426.jpg");
border-radius: 50%;
}
.inner {
height: 100%;
width: 100%;
box-shadow: 0 0 15px 15px rgba(250, 250, 250, 1) inset;
border-radius: 45%;
}
.homeimg01:hover {
transform: scale(1.1);
}
<div class="homescreen2">
<div class="homeimg01 hometransition">
<div class="inner"></div>
</div>
</div>
Have a div inside your image div and set the box shadow on that, then set it's border-radius to 45% instead of 50%.

Without text these div elements are fine but when i put text in the boxes it changes the box [duplicate]

This question already has answers here:
CSS vertical alignment of inline/inline-block elements
(4 answers)
Closed 2 years ago.
So I have this:
Then I add text:
.front {
background: #e0e0e0;
width: 100%;
height: 200px;
border: 5px solid black;
}
#keyframes animateonload {
0% {
top: 0;
left: 200px;
background: #80ed9d;
}
25% {
top: 200px;
left: 200px;
background: #9f80ed;
}
50% {
top: -101px;
left: -900px;
background: #eda380;
}
75% {
top: 900px;
left: 200px;
background: #3e6b66;
}
100% {
top: 450px;
left: 100px;
background: #ccfa8c;
}
}
body {
animation-name: animateonload;
animation-duration: 5s;
animation-iteration-count: 1;
position: relative;
width: 100%;
height: auto;
}
.divver3 {
width: 33%;
height: 600px;
background: #faa68c;
font-size: 20px;
display: inline-block;
grid-column: 3;
grid-row: 1;
}
.divver2 {
width: 33%;
height: 600px;
background: #faa68c;
font-size: 20px;
display: inline-block;
grid-column: 2;
grid-row: 1;
}
.divver1 {
width: 33%;
height: 600px;
background: #faa68c;
font-size: 20px;
display: inline-block;
grid-column: 1;
grid-row: 1;
}
.div {
width: 100%;
height: auto;
}
.divver1 h1 {
text-align: center;
margin: 0;
}
<div class="div">
<div class="divver1">
<h1> Price option 1 </h1>
</div>
<div class="divver2">
</div>
<div class="divver3">
</div>
</div>
</div>
So why does my thing do this when I add text to the box? I have no answer, and how can this do this?
Is this just a flaw in my code in the .divver?
The code contains the full grid layout, and correct <div> positioning so why hasn't this worked?
Is it that I need padding/margins? Or does the width need to vary each box? Please help me.
Thank you,
Ring Games
display: inline-block will, by default, vertically align elements according to their baseline.
When they're empty, the baseline is just the bottom of the element.
But when you add some text, the baseline is the baseline of that text. Notice how the bottom of the text is now aligned to the bottom of the other elements.
In this case you may be better off with display: grid;, display: flex; or maybe even column-count: 3; to achieve your layout, but if you're stuck with what you've got then adding vertical-align: top; should do the trick.
Try making your position absolute like this:
.front {
background: #e0e0e0;
width: 100%;
height: 200px;
border: 5px solid black;
}
#keyframes animateonload {
0% {top: 0; left: 200px; background: #80ed9d;}
25% {top: 200px; left: 200px; background: #9f80ed;}
50% {top: -101px; left: -900px; background: #eda380;}
75% {top: 900px; left: 200px; background: #3e6b66;}
100% {top: 450px; left: 100px; background: #ccfa8c;}
}
body {
animation-name: animateonload;
animation-duration: 5s;
animation-iteration-count: 1;
position: relative;
width: 100%;
height: auto;
}
.divver3 {
width: 33%;
height: 600px;
background: #faa68c;
font-size: 20px;
display: inline-block;
grid-column: 3;
grid-row: 1;
}
.divver2 {
width: 33%;
height: 600px;
background: #faa68c;
font-size: 20px;
display: inline-block;
grid-column: 2;
grid-row: 1;
}
.divver1 {
width: 33%;
height: 600px;
background: #faa68c;
font-size: 20px;
display: inline-block;
grid-column: 1;
grid-row: 1;
position: absolute;
}
.div {
width: 100%;
height: auto;
}
.divver1 h1 {
text-align: center;
margin: 0;
}
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title> Ring Games - Official Site</title>
</head>
<body>
<div class="div">
<div class="divver1">
<h1>this is some text</h1>
</div>
<div class="divver2">
</div>
<div class="divver3">
</div>
</div>
</body>
</html>

Is it possible to put divs in this way?

One color on image symbolizes one div. Is it possible to put first div under second, second under third, third under fourth, and fourth under first?
Is it possible to do with pure CSS (without SVG/image etc.)?
You can also play with transform:rotate
div {
position: relative;
transform-style: preserve-3d;
perspective: 1000px;
display: grid;
grid-template-columns: 300px 300px;
grid-template-rows: 200px 200px;
}
div p {
margin: 2em;
}
div :nth-child(1),
div :nth-child(2) {
background: lightblue;
margin: 0 3em;
grid-column: 2;
grid-row: 1 / span 2;
}
div :nth-child(1) {
background: black;
grid-column: 1;
color: white;
}
div :nth-child(3),
div :nth-child(4) {
background: yellow;
margin: 2em 1em;
grid-column: 1 / span 2;
grid-row: 1;
}
div :nth-child(4) {
background: lightgreen;
grid-row: 2;
}
div :nth-child(1) {
transform: rotateX(1deg)
}
div :nth-child(2) {
transform: rotateX(-1deg)
}
<div>
<p>one</p>
<p>two</p>
<p>three</p>
<p>four</p>
</div>
Nope - tis is impossible (at least by using z-index layers) - however you can use some trick to get this effect e.g use 5 div-s:
.boxA {
position: absolute;
width: 97px;
height: 175px;
background: black;
left: 17px;
z-index: 2;
}
.boxB {
position: absolute;
width: 248px;
height: 60px;
background: yellow;
top: 32px;
z-index: 3;
}
.boxC {
position: absolute;
width: 248px;
height: 60px;
background: #00ff7b;
top: 112px;
z-index: 1;
}
.boxD {
position: absolute;
width: 62px;
height: 175px;
background: cyan;
left: 157px;
z-index: 0;
}
.boxE {
position: absolute;
width: 62px;
height: 100px;
background: cyan;
left: 157px;
z-index: 4;
}
<div class="boxA"></div>
<div class="boxB"></div>
<div class="boxC"></div>
<div class="boxD"></div>
<div class="boxE"></div>

slide does not comply with grid measurements

The id c4 is occupying row 2 / span 1, and the slider should only be taking those row also because its measurements are going from row 2 / span 1, how would I put it into the div slidecourse correctly?
#c4{
background: white;
z-index: 0;
min-height: 200vh;
min-width: 100vw;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
grid-template-rows: 20vh 60vh 5vh 15vh 15vh 85vh;
}
#c4 h1{
grid-column: 1 / -1;
grid-row: 1 / span 1;
text-align: center;
align-self: center;
font-size: 2em;
}
#c4 .textoscurso{
grid-column: 3 / span 3;
grid-row: 2 / span 1;
align-self: center;
}
#c4 .textoscurso p{
align-self: center;
}
#c4 .slidecurso{
grid-column: 7 / -1;
grid-row: 2 / span 1;
}
#c4 .slidecurso slider{
display: inline-block;
width: 100%;
height: 100%;
background: #0ff;
overflow: hidden;
position: absolute;
}
slider > *{
position: absolute;
display: block;
width: 100%;
height: 100%;
background: #0ff;
animation: slide 12s infinite;
overflow: hidden;
}
slide:nth-child(1){
left: 0;
animation-delay: -1s;
background-image: url(../img/curso.jpg);
background-size: cover;
background-position: center;
}
slide:nth-child(2){
animation-delay: 2s;
background-image: url(../img/curso.jpeg);
background-size: cover;
background-position: center;
}
slide:nth-child(3){
animation-delay: 5s;
background-image: url(../img/curso.jpg);
background-size: cover;
background-position: center;
}
slide:nth-child(4){
left: 0;
animation-delay: 8s;
background-image: url(../img/curso.jpg);
background-size: cover;
background-position: center;
}
slide p{
font-family: Comfortaa;
font-size: 70px;
text-align: center;
display: inline-block;
width: 100%;
margin-top: 100px;
color: #fff;
}
#keyframes slide{
0%{left: 100%; width: 100%;}
5%{left: 0%;}
25%{left: 0%;}
30%{left: -100%; width: 100%;}
30.0001%{left: -100%; width: 0%;}
100%{left: 100%; width: 0%;}
}
#c4 .motivos{
background: lightgray;
grid-row: 4 / span 2;
z-index: 10;
}
#c4 .moti-1{
grid-column: 2 / span 2;
}
#c4 .moti-2{
grid-column: 5 / span 2;
}
#c4 .moti-3{
grid-column: 8 / span 2;
}
#c4 .c4-2{
grid-row: 5 / -1;
grid-column: 1 / -1;
background: black;
}
<content id="c4">
<h1>Venha aprender com a gente</h1>
<div class="textoscurso">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus egestas posuere purus malesuada mattis.</div>
<div class="slidecurso">
<slider>
<slide><p>Slide 1</p></slide>
<slide><p>Slide 2</p></slide>
<slide><p>Slide 3</p></slide>
<slide><p>Slide 4</p></slide>
</slider>
</div>
<div class="motivos moti-1"></div>
<div class="motivos moti-2"></div>
<div class="motivos moti-3"></div>
<div class="c4-2"></div>
</content>
The blue slide is not correctly sized as it should and then it goes beyond the limited heigth.
I need it to be exactly inside row 2 / apan 1. Please
You need to add position:relative to the slide element since the child are set to position:absolute. In this case the width/height will be relative to that element and you won't have overflow:
I have also removed some useless properties that may create issues (min-width:100vw for example):
body {
margin:0;
}
#c4 {
background: white;
min-height: 200vh;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
grid-template-rows: 20vh 60vh 5vh 15vh 15vh 85vh;
}
#c4 h1 {
grid-column: 1 / -1;
grid-row: 1 / span 1;
text-align: center;
align-self: center;
font-size: 2em;
}
#c4 .textoscurso {
grid-column: 3 / span 3;
grid-row: 2 / span 1;
align-self: center;
}
#c4 .textoscurso p {
align-self: center;
}
#c4 .slidecurso {
grid-column: 7 / -1;
grid-row: 2 / span 1;
position: relative;
}
#c4 .slidecurso slider {
width: 100%;
height: 100%;
background: #0ff;
overflow: hidden;
position: absolute;
}
slider>* {
position: absolute;
display: block;
width: 100%;
height: 100%;
background: #0ff;
animation: slide 12s infinite;
overflow: hidden;
}
slide:nth-child(1) {
left: 0;
animation-delay: -1s;
background-image: url(../img/curso.jpg);
background-size: cover;
background-position: center;
}
slide:nth-child(2) {
animation-delay: 2s;
background-image: url(../img/curso.jpeg);
background-size: cover;
background-position: center;
}
slide:nth-child(3) {
animation-delay: 5s;
background-image: url(../img/curso.jpg);
background-size: cover;
background-position: center;
}
slide:nth-child(4) {
left: 0;
animation-delay: 8s;
background-image: url(../img/curso.jpg);
background-size: cover;
background-position: center;
}
slide p {
font-family: Comfortaa;
font-size: 70px;
text-align: center;
display: inline-block;
width: 100%;
margin-top: 100px;
color: #fff;
}
#keyframes slide {
0% {
left: 100%;
width: 100%;
}
5% {
left: 0%;
}
25% {
left: 0%;
}
30% {
left: -100%;
width: 100%;
}
30.0001% {
left: -100%;
width: 0%;
}
100% {
left: 100%;
width: 0%;
}
}
#c4 .motivos {
background: lightgray;
grid-row: 4 / span 2;
z-index: 10;
}
#c4 .moti-1 {
grid-column: 2 / span 2;
}
#c4 .moti-2 {
grid-column: 5 / span 2;
}
#c4 .moti-3 {
grid-column: 8 / span 2;
}
#c4 .c4-2 {
grid-row: 5 / -1;
grid-column: 1 / -1;
background: black;
}
<content id="c4">
<h1>Venha aprender com a gente</h1>
<div class="textoscurso">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus egestas posuere purus malesuada mattis.</div>
<div class="slidecurso">
<slider>
<slide>
<p>Slide 1</p>
</slide>
<slide>
<p>Slide 2</p>
</slide>
<slide>
<p>Slide 3</p>
</slide>
<slide>
<p>Slide 4</p>
</slide>
</slider>
</div>
<div class="motivos moti-1"></div>
<div class="motivos moti-2"></div>
<div class="motivos moti-3"></div>
<div class="c4-2"></div>
</content>