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;
Related
i need to make angles around the button.
I have tried made by ::after ::before, but i cant
Original: bottom of this site
https://kirarock.team/
[enter image description here][1]
my code is here
https://codepen.io/Artyom2022/pen/LYmoaOY
[1]: https://i.stack.imgur.com/M0qgS.png
Thanks in advance
I have used SCSS
for made angles i have used transform-origin;
$clip_input: polygon(2% 0, 100% 0, 100% 100%, 7% 100%);
$clip_submit: polygon(85% 0, 97% 51%, 85% 100%, 15% 100%, 3% 50%, 15% 0);
$border-color: #fff;
.form {
display: grid;
grid-template: 1fr / repeat(2, 1fr);
gap: 70px;
}
.button {
grid-column: 1/3;
align-self: center;
justify-self: center;
text-align: center;
display: grid;
grid-template-rows: 1fr;
grid-template-columns: 1fr 1fr 1fr;
justify-content: center;
&__wrapper {
background-color: #00c9ff;
clip-path: polygon(85% 0, 97% 51%, 85% 100%, 15% 100%, 3% 50%, 15% 0);
padding: 2px;
display: inline-block;
input {
clip-path: polygon(85% 0, 97% 51%, 85% 100%, 15% 100%, 3% 50%, 15% 0);
background-color: black;
border: none;
padding: 15px 57px;
color: #00c9ff;
font-weight: 100;
font-size: 2rem;
line-height: 130%;
text-align: center;
letter-spacing: 0.3em;
text-transform: uppercase;
cursor: pointer;
font-family: RobotoCondensed, sans-serif !important;
.button:hover {
background-color: #00c9ff;
color: black;
}
}
}
span:first-child {
margin-right: 25px;
justify-self: end;
top: 0;
display: grid;
&::before {
transform-origin: bottom right;
display: inline-block;
content: '';
background-color: #00C9FF;
width: 1px;
transform: rotate(45deg);
}
&::after {
transform-origin: top left;
display: inline-block;
content: '';
background-color: #00C9FF;
width: 1px;
transform: rotate(-45deg);
}
}
span:last-child {
margin-left: 25px;
justify-self: start;
top: 0;
display: grid;
&::before {
transform-origin: bottom right;
display: inline-block;
content: '';
background-color: #00C9FF;
width: 1px;
transform: rotate(-45deg);
}
&::after {
transform-origin: top left;
display: inline-block;
content: '';
background-color: #00C9FF;
width: 1px;
transform: rotate(45deg);
}
}
<div class="button">
<span></span>
<div class="button__wrapper"><input class="submit" type="submit" value="Send">
</div>
<span></span>
</div>
I have this code:
.container {
margin-right: auto;
margin-left: auto;
max-width: 1400px;
padding-left: 1rem;
padding-right: 1rem;
}
.grid { display: grid }
.vh-100 { min-height: 100vh;}
.grid-gap { grid-gap: 0.7rem; }
.flex { display: flex; -webkit-display: flex; -moz-display: flex; -ms-display: flex; -o-display: flex; }
.text-center { text-align: center; }
.flex-dir-col { flex-direction: column; }
.relative { position: relative; }
.absolute { position: absolute; }
.img-fluid { max-width: 100%; height: auto; }
.content-wrapper .container {
grid-auto-flow: row dense;
-ms-grid-columns: 3fr 1fr;
grid-template-columns: 3fr 1fr;
-ms-grid-rows: 1fr;
grid-template-rows: 1fr;
gap: 0px 35px;
}
.content-wrapper .container .main-content {
-ms-grid-row: 1;
-ms-grid-row-span: 1;
-ms-grid-column: 1;
-ms-grid-column-span: 2;
grid-area: 1 / 1 / 2 / 3;
}
.content-wrapper .container .main-content .post-content .post-content-top .post-sharing .icon {
width: 50px;
height: 50px;
background-color: #f1f1f1;
margin-bottom: 20px;
border-radius: 30%;
-webkit-border-radius: 30%;
-moz-border-radius: 30%;
-ms-border-radius: 30%;
-o-border-radius: 30%;
color: #3ab77d;
-webkit-box-shadow: 0px 5px 15px -5px #00000070;
box-shadow: 0px 5px 15px -5px #00000070;
}
.content-wrapper .container .main-content .post-content .post-content-top .post-sharing .icon i {
line-height: 50px;
font-size: 20px;
transition: all .4s;
-webkit-transition: all .4s;
-moz-transition: all .4s;
-ms-transition: all .4s;
-o-transition: all .4s;
}
.content-wrapper .container .main-content .post-content .post-content-top .post-sharing .icon:hover {
background-color: #3ab77d;
}
.content-wrapper .container .main-content .post-content .post-content-top .post-sharing .icon:hover i {
color: #f1f1f1;
}
.content-wrapper .container .main-content .post-content .post-content-top .post-featured-image {
overflow: hidden;
}
.content-wrapper .container .main-content .post-content .post-content-top .post-featured-image .post-date {
top: 1rem;
left: 1rem;
background-color: #fff;
width: 50px;
height: 50px;
line-height: 1.5;
}
.content-wrapper .container .main-content .post-content .post-content-top .post-featured-image .post-date .day {
font-size: 1rem;
padding-top: .2rem;
}
.content-wrapper .container .main-content .post-content .post-content-top .post-featured-image .post-date .month {
font-size: 0.75rem;
}
.content-wrapper .container .sidebar {
-ms-grid-row: 1;
-ms-grid-row-span: 1;
-ms-grid-column: 2;
-ms-grid-column-span: 1;
grid-area: 1 / 2 / 2 / 3;
position: relative;
background-color: rgba(255, 0, 0, 0.468);
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons#1.8.3/font/bootstrap-icons.css" rel="stylesheet"/>
<section class="content-wrapper mt-2 mb-2">
<div class="container grid vh-100 grid-gap">
<div class="main-content">
<div class="post-content">
<div class="post-content-top flex">
<div class="post-sharing flex flex-dir-col mr-1 text-center">
<i class="bi bi-facebook"></i>
<i class="bi bi-twitter"></i>
<i class="bi bi-reddit"></i>
<i class="bi bi-whatsapp"></i>
</div>
<div class="post-featured-image relative">
<img src="https://cdn.pixabay.com/photo/2022/06/14/17/30/beach-7262493_1280.jpg" class="img-fluid">
<div class="post-date absolute flex flex-dir-col text-center">
<span class="day">23</span>
<span class="month">JUL</span>
</div>
</div>
</div>
</div>
</div>
<div class="sidebar">
This is the sidebar
</div>
</div>
</section>
So this should be a blog like layout with a main content and a sidebar on the right. My problem is that the image is overflowing its div and it flows underneath the sidebar. I added a slightly transparent background color to the sidebar so it's more visible.
I tried to add max-width: 100% and height: auto; to the image as recommended here, but it didn't work. I also tried to add overflow: hidden to the parent div of the image, but no luck. But I wouldn't want to clip the image anyway.
I don't understand because max-width: 100% and height: auto; should make the image responsive, right?
Any idea what I'm doing wrong? Thanks
There are 2 ways to achieve this:
You can cut the image which is being overflowed.
overflow-x: hidden;
You can either give detailed stylings, like this
*{
margin: 0;
padding:0;
}
img{
width: 100%;
height: 100%;
}
.image_container{
max-width: 100vw;
max-height: 100vw;
}
<div class="image_container">
<img src="https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/80a9d98d-327f-4bb2-b173-4298d710e51c/derkflv-9f975f3d-791f-4e16-8d9d-fb0a9e5e0554.png?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7InBhdGgiOiJcL2ZcLzgwYTlkOThkLTMyN2YtNGJiMi1iMTczLTQyOThkNzEwZTUxY1wvZGVya2Zsdi05Zjk3NWYzZC03OTFmLTRlMTYtOGQ5ZC1mYjBhOWU1ZTA1NTQucG5nIn1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmZpbGUuZG93bmxvYWQiXX0.eEDVAlJGBqXo6OeZEORXWk1veGSHFL-ZTUMz43Jtr3Q" alt="image">
<div>
does anyone know how I can center the white circle into to middle of the blue circle and set the white circle above all other elements? I tried with relative and absolute positioning and with the z-index but I couldnt get it to work. I'm kinda a noob in CSS
.start-container {
height: 100vh;
display: grid;
grid-template-rows: 20% 65% 15%;
grid-template-areas: "header" "startpage" "footer";
}
.header {}
.header-shape {
height: 100%;
background-color: blue;
clip-path: polygon(0 60%, 100% 40%, 100% 100%, 0% 100%);
}
.profile-shape {
position: absolute;
top: 7vw;
left: 65vw;
width: 10vw;
height: 10vw;
background-color: blue;
border-radius: 50%;
filter: drop-shadow(0px 3px 30px rgba(0, 0, 0, 0.60));
}
.profile-picture {
width: 90%;
height: 90%;
background-color: white;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
margin: -50% 0 0 -50%;
}
.startpage {}
.footer {
background-color: yellow;
}
<div class="start-container">
<div class="header">
<div class="profile-shape">
<div class="profile-picture"></div>
</div>
<div class="header-shape"></div>
</div>
<div class="startpage"></div>
<div class="footer"></div>
</div>
If you give your shape a z-index, it will put it on top. Make it flex with justify-content and align-items center and that will centre your profile (after removing the absolute positioning):
.start-container {
height: 100vh;
display: grid;
grid-template-rows: 20% 65% 15%;
grid-template-areas: "header" "startpage" "footer";
}
.header {}
.header-shape {
height: 100%;
background-color: blue;
clip-path: polygon(0 60%, 100% 40%, 100% 100%, 0% 100%);
}
.profile-shape {
position: absolute;
top: 7vw;
left: 65vw;
width: 10vw;
height: 10vw;
background-color: blue;
border-radius: 50%;
filter: drop-shadow(0px 3px 30px rgba(0, 0, 0, 0.60));
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
.profile-picture {
width: 90%;
height: 90%;
background-color: white;
border-radius: 50%;
}
.startpage {}
.footer {
background-color: yellow;
}
<div class="start-container">
<div class="header">
<div class="profile-shape">
<div class="profile-picture"></div>
</div>
<div class="header-shape"></div>
</div>
<div class="startpage"></div>
<div class="footer"></div>
</div>
Per comment, if you want blue circle (changed to red in example below) below and white above, you would need to have an extra object otherwise the white circle will always be on the same stacking context as it's parent:
.start-container {
height: 100vh;
display: grid;
grid-template-rows: 20% 65% 15%;
grid-template-areas: "header" "startpage" "footer";
}
.header {}
.header-shape {
height: 100%;
background-color: blue;
clip-path: polygon(0 60%, 100% 40%, 100% 100%, 0% 100%);
}
.profile-placement {
position: absolute;
top: 7vw;
left: 65vw;
width: 10vw;
height: 10vw;
}
.profile-placement--shape {
background-color: red;
border-radius: 50%;
filter: drop-shadow(0px 3px 30px rgba(0, 0, 0, 0.60));
}
.profile-placement--picture {
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
.profile-picture {
width: 90%;
height: 90%;
background-color: white;
border-radius: 50%;
}
.startpage {}
.footer {
background-color: yellow;
}
<div class="start-container">
<div class="header">
<div class="profile-placement profile-placement--shape">
</div>
<div class="profile-placement profile-placement--picture">
<div class="profile-picture"></div>
</div>
<div class="header-shape"></div>
</div>
<div class="startpage"></div>
<div class="footer"></div>
</div>
Just adjust the margin with the remaining height and width on the profile-picture class.
The remaining size is 10% height and 10% weight. So there will be +5%(-45%) on the left margin and +5%(-45%) on the top margin. It will make the circle center
.start-container{
height: 100vh;
display: grid;
grid-template-rows: 20% 65% 15%;
grid-template-areas:
"header"
"startpage"
"footer"
;
}
.header{
}
.header-shape{
height: 100%;
background-color: blue;
clip-path: polygon(0 60%, 100% 40%, 100% 100%, 0% 100%);
}
.profile-shape{
position: absolute;
top: 7vw;
left: 65vw;
width: 10vw;
height: 10vw;
background-color: blue;
border-radius: 50%;
filter: drop-shadow(0px 3px 30px rgba(0,0,0,0.60));
}
.profile-picture{
width: 90%;
height: 90%;
background-color: white;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
margin: -45% 0 0 -45%;
}
.startpage{
}
.footer{
background-color: yellow;
}
<div class="start-container">
<div class="header">
<div class="profile-shape">
<div class="profile-picture"></div>
</div>
<div class="header-shape"></div>
</div>
<div class="startpage"></div>
<div class="footer"></div>
</div>
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>
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>