Тёмный

Pure CSS Responsive Image Slider - HTML5/CSS3 Tutorial 

w3newbie
Подписаться 15 тыс.
Просмотров 380 тыс.
50% 1

➢Pure HTML/CSS Course: w3newbie.com/html-css-course/
➢Tutorial Files: m.w3newbie.com/w/tutorial-12.zip
➢Website Template Bundle: w3newbie.com/template-bundle/
In this video we'll create a Pure CSS Responsive Image Slider using HTML5 and CSS3.

Опубликовано:

 

2 мар 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 299   
@thydevdom
@thydevdom 2 года назад
Finally a tutorial that just covers the basics. This allows us to go do more digging on our own without having to sit through a 25 minute tutorial of something way more complex.
@jakeblake8851
@jakeblake8851 2 года назад
I've literally never commented on any RU-vid video ever but I just had to, this is the best tutorial video I've encountered in my web dev career, very simple, straight forward and yet very effective, BRAVO!
@mikesmart9279
@mikesmart9279 5 лет назад
Thanks so much, I have tried loads of these tutorials to make a responsive slider, but this is the only one I’ve had any success with. And you explained enough to tweak the number of images used etc. Well done you!!!
@w3newbie
@w3newbie 5 лет назад
Awesome! I'm glad this helped :) thanks for watching.
@echo_4482
@echo_4482 2 года назад
You are probably never going to read this, but my god am I thankful for this tutorial! I am very new to HTML/CSS coding and have been looking for a good tutorial for a slideshow for literally a few days. Yours was by far the best out of the bunch, so again: Thanks a lot! :D
@ladslousdaka5615
@ladslousdaka5615 9 месяцев назад
simple and straight forward, i have finally find the tutorial i have been looking for. thank you very much
@nehadharmavat2314
@nehadharmavat2314 3 года назад
I was gone mad when the slides weren't working...then I came across your video and it made my all problems solved...thank you so much love you❤❤❤
@firstnameusagi9158
@firstnameusagi9158 2 года назад
this is so easy compared to other ones. thank you.
@ares9335
@ares9335 2 года назад
Fantastic tutorial, was looking for something simple without any external js or crazy css styling. It lacks buttons but gets the job done. +1 like from me.
@rohitsahu1443
@rohitsahu1443 3 года назад
best slider video on youtube,simple and easy to understand.Thanks brother 👍
@josephfatoye6293
@josephfatoye6293 3 года назад
I love you bro, this is really more easier and effective compared to other tutorials
@denis5555
@denis5555 4 года назад
10-image code. I've used images with the same ratio, not necessarily the same width/height: CSS: #slider{ overflow: hidden; width: 70%; } #slider figure{ position: relative; width: 1000%; margin: 0; left: 0; animation: 20s slider infinite; } #slider figure img{ width: 10%; float: left; } @keyframes slider{ 0% {left: 0;} 5.2% {left: 0;} 10.4% {left: -100%;} 15.6% {left: -100%;} 20.8% {left: -200%;} 26% {left: -200%;} 31.2% {left: -300%;} 36.4% {left: -300%;} 41.6% {left: -400%;} 46.8% {left: -400%;} 52% {left: -500%;} 57.2% {left: -500%;} 62.4% {left: -600%;} 67.6% {left: -600%;} 72.8% {left: -700%;} 78% {left: -700%;} 85% {left: -800%;} 90% {left: -800%;} 100% {left: -900%;} } HTML:
@ashrafulrahmansakil9612
@ashrafulrahmansakil9612 2 года назад
a lot of thanks
@MujtabaRaza110
@MujtabaRaza110 8 месяцев назад
love u as the vid code wasnt working and your worked i dont know how
@QuantamOp
@QuantamOp 3 года назад
this was that video i was waiting for
@sabrinasung1618
@sabrinasung1618 2 года назад
brilliant this is the kind of tutorial i've been searching for thankyou very much it was easy and effective
@mrleon1115
@mrleon1115 2 года назад
3:46 i have the exact same code, but i don't know why my images wont slide #slider { overflow: hidden; } #slider figure { position: relative; width: 500%; margin: 0; left: 0; animation: 20s slider infinite; }
@amofsdc8126
@amofsdc8126 3 года назад
Thanks ! Very good to begin learning sliders with CSS.
@tonywest9146
@tonywest9146 3 года назад
Thanks man kudoosss your style worked like magic
@Rupgen
@Rupgen 4 года назад
Thank you so much! It helped a lot.
@michaelkasili
@michaelkasili 4 года назад
@w3newbie do the images need to be the same size or resolution? I've been having difficulty trying to design a carousel.
@182uday8
@182uday8 2 года назад
Thanks somuch I was searching for this
@nikolanovakovic4150
@nikolanovakovic4150 Год назад
bro such an elegant solution very nice ! kudos
@amankhanna354
@amankhanna354 2 года назад
The best slider tut🔥
@josemilsonsousa
@josemilsonsousa 2 года назад
Thank you very much for the turorial, your video was a great help to me
@martinsosa7401
@martinsosa7401 5 лет назад
Hello, i have the same problem, but i cant fix it, i want to put 5 images but after the 5th, there is a "bug", the screen appears white, and starts again (with the 1st image) like 1 second after, i put -500% in the keyframes, but the problem didnt dissapear. How did u do it? I want to show 5 images, i have the figure tag like this: And the keyframes like this: @keyframes slider { 0% { left: 0; } 10% { left: 0; } 20% { left:-100%; } 30% { left: -100%;; } 40% { left: -200%; } 50% { left: -200%; } 60% { left: -300%; } 70% { left: -300%; } 80% { left: -400%; } 90% { left: -400%; } 100% { left: -500%; } } whats wrong?
@geraloveyourselfff5048
@geraloveyourselfff5048 2 года назад
Thank you for this tutorial, it really helped me!
@somaghosh3211
@somaghosh3211 3 года назад
Excellent video!!!!! I have tried it and it is working nicely. Thank you.
@jeanednorpaul1068
@jeanednorpaul1068 4 года назад
or can you explain how the @keyframes is supposed to set up, cause there must be a way to do it so it can work with any numbers of pictures you have to insert in the slide....! I put it in a div after the menu list, it push the menu down when I try to resize the div so it can fit in my screen, of course, the menu gets back on the top, but never get it correctly fit the div slide..
@dipeshshrestha2086
@dipeshshrestha2086 4 года назад
Thank you so much sir, I appreciate a lot. Your material was short, sweet and effective and it worked so fine with my project. Thank you again, I want to learn more please add some more contents and ideas.
@evenciomendes2036
@evenciomendes2036 4 года назад
Very simple , clean e nice example
@telmocosta5745
@telmocosta5745 3 года назад
so good! thanks for the help!
@yasinarafat2218
@yasinarafat2218 3 года назад
i'd like to thank you a lot . because it help me to be good at in css.
@honeydroptv1320
@honeydroptv1320 4 года назад
OHHH MY GODDDDD. SUPER ............. VERY VERY THANK YOU SIR, THANK YOU , THANK YOU
@Lisa-db9ld
@Lisa-db9ld 2 года назад
This is great! Thank you!
@Luciel_yt
@Luciel_yt Год назад
thank you
@akashbag2270
@akashbag2270 2 года назад
Thanks it helps a lot
@craigjohnson8279
@craigjohnson8279 5 лет назад
This is a great video. Thanks for sharing the knowledge! :)
@w3newbie
@w3newbie 5 лет назад
Thanks for watching and subscribing!
@user-rx5yz7hp6t
@user-rx5yz7hp6t 3 года назад
Thank You So Much This Lesson Is So Good
@vethumdasanayaka6274
@vethumdasanayaka6274 2 года назад
Thank You Very Much, Sir !!. It Worked.
@dadymer2366
@dadymer2366 4 года назад
Many thanks, great CSS code :)
@ekdumbindaas3613
@ekdumbindaas3613 4 года назад
Its amazing you're awesome.
@shortsslv
@shortsslv 3 года назад
really very nice and easy tutorial in comparison to other tutorials I watched on youtube explanation sir Thanks a lot
@aster727
@aster727 4 года назад
How do I get rid of the large white space at the bottom of the image? It leaves major distance between my slideshow and the information I wrote for the website
@cristianscript5649
@cristianscript5649 5 лет назад
you are awesome bro this method is awesome cause I saw another tutorial about this, and they messed with the animation times for every nth:child in image, this was way shorter and awesome
@w3newbie
@w3newbie 5 лет назад
Thanks! Yea I think it's the easiest way for a CSS slider.
@vamshichoula8248
@vamshichoula8248 3 года назад
bro i tried exact code iam not getting exact output. please help me
@kevinbeharrilal1609
@kevinbeharrilal1609 4 года назад
after using this code my responsive hamburger menu dident show up when on a small screen also the nav bar on the large screen is very small please can you help
@aitana6455
@aitana6455 4 года назад
What should I change to customize the height of it? And where? I tried everything I could think of, but Im quite new to html and css... pls help
@mahek9015
@mahek9015 2 года назад
You are Amazing💯💯 Thnx man🔥⚡✨
@shubhamverma5426
@shubhamverma5426 2 года назад
thanks bro for learn to make image slider love you
@sitishakirahshahpri6041
@sitishakirahshahpri6041 4 года назад
thank you sir for this video.. it helps me a lot!
@maxwilsonpereira
@maxwilsonpereira 4 года назад
Thank you so much for this tutorial! It helped me a lot! MORE IMAGES: I made some changes in order to use with MORE IMAGES / PICTURES. Here is my code: CSS: #slider { overflow: hidden; } #slider figure { position: relative; width: 1000%; /* 100% for each picture, 10 pictures = 1000% */ margin: 0; left: 0; animation: 40s slider infinite; } #slider figure img { width: 10%; /* 100 / 10 pictures = 10% */ height: 700px; /* to set a maximum height */ float: left; /* next 2 to continue responsive with the maximum height */ max-width: 100%; min-height: 100%; object-fit: cover; } @keyframes slider { 0% { left: 0; } /* you must divide 100% fot the amout of images you have */ 7% { left: 0%; } /* these intermediate steps (7%, 17%, 27%, ... will make the transition speed faster */ 10% { left: -100%; } /* because my total width: 1000% (10x 100% for 10 images), I will use 10% for each image */ 17% { left: -100%; } 20% { left: -200%; } 27% { left: -200%; } 30% { left: -300%; } 37% { left: -300%; } 40% { left: -400%; } 47% { left: -400%; } 50% { left: -500%; } 57% { left: -500%; } 60% { left: -600%; } 67% { left: -600%; } 70% { left: -700%; } 77% { left: -700%; } 80% { left: -800%; } 87% { left: -800%; } 90% { left: -900%; } 100% { left: -900%; } } HTML:
@edward1412
@edward1412 4 года назад
What were the width and height of your images?
@maxwilsonpereira
@maxwilsonpereira 4 года назад
@@edward1412 1200 X 800 pixels. Good luck.
@edward1412
@edward1412 4 года назад
@@maxwilsonpereira Thank you for the quick reply. Really appreciate it. I tried to use the video tutorial as a guide for my slides in my project work, however, all the 5 images remained vertical and visible, and this was because the "slider figure img" couldn't float left. Interestingly, I was able to get the slides working when I created a new file with only the images content. I realised that the "media queries css" prevent the images from floating left on my project. I will try and use your code and see what happens.
@edward1412
@edward1412 4 года назад
@@maxwilsonpereira I had a few problems after completing it. The slides worked though. 1. The images shown are too wide to the extend that, it can't be seen clearly. It's like looking at bitmaps. 2. A white space(without a slide) is shown at the end of each slide show, before it restarts.
@edward1412
@edward1412 4 года назад
@@maxwilsonpereira First of all, I would like to thank you. I've got it working now in my project. There's one problem down. It doesn't work in a desktop view (all the 10 images are shown vertically on the page). However, when scaled to a mobile view, it works.
@federicarosi9584
@federicarosi9584 2 года назад
a big thank you!
@stanesaduwha3633
@stanesaduwha3633 4 года назад
Thanks mate for the tutorial. It was indeed very helpful. My question is how do we calculate percentages during @keyframe for six images
@oii_sam
@oii_sam 3 года назад
amigo, eu não entendo inglês, mas você me ajudou muito. Muito Obrigado!!! Abraços do Brasil
@JimCraft123
@JimCraft123 4 года назад
Is it possible to add button to the left and right to control the img, and will the button breaks the site ? i mean they are not responsive if set them to position absolute
@abinanda.v6956
@abinanda.v6956 4 года назад
Its working...Thank you man...
@erikT131
@erikT131 5 лет назад
Keep up the great work
@posivibez2094
@posivibez2094 3 года назад
Super helpful and simple, thanks. Would love to see how to trigger advancing slides with a button.
@chrissyabby208
@chrissyabby208 4 года назад
What version of sublime text did you use for this work? Is the sublime text registered?
@brycejdev6419
@brycejdev6419 5 лет назад
easily the best tutorial for a pure css slider ... is there an option to like a video 20 times?
@matchmasterstips
@matchmasterstips 7 месяцев назад
hi bro thank you so much for this great video.. ♥ i have only 1 issue.. when i add links with images .. last image don't stay for 5 seconds it takes only 1 second and then don't go to back to 1 image like slide . it only jump to first image.. can u plz tell me he solution . my english is not good but i hope u understand my issue i m using like this
@ahmedtlijeni9828
@ahmedtlijeni9828 2 года назад
Thank you so much bro.. , you really helped me.
@robertmullinslives
@robertmullinslives 2 года назад
this has been awesome! Question. I want to put some social media icons into the slider rotation, but I want the images to be a different size than everything else in the slider rotation. How could I do that?
@axelroses8139
@axelroses8139 4 года назад
short but excellent.. !!!
@vonputt5457
@vonputt5457 2 года назад
thanks a lot sir, you save my day, i really appreciate
@syedharoona4355
@syedharoona4355 2 года назад
Thank you for your information it was helpful for me to create a project
@paulocesarchaves87
@paulocesarchaves87 3 года назад
Great Vid!!! congrats!!!
@usmanmughal5916
@usmanmughal5916 3 года назад
I dont know I downlaoded pictures of same size 1920x1280 but it didn't work correctly one image was below other and when its moved to left its more messier cuz it stops in the middle.
@digigoliath
@digigoliath 3 года назад
Awesome!!! TQVM!!
@syedshufkatali6585
@syedshufkatali6585 3 года назад
what should I change in coding if I want to make 8 images to slide? You have inserted 5 images in slideshow, how can I make it slide 8 times for 8 images?
@gagikavagyan9920
@gagikavagyan9920 4 года назад
This slayder is the best
@nguyenanhtuan6371
@nguyenanhtuan6371 5 лет назад
This is a great video.
@w3newbie
@w3newbie 5 лет назад
Thanks!
@jeanednorpaul1068
@jeanednorpaul1068 4 года назад
it work for me, but i have a question, does the number of picture is matter, cause when i'm making it with 5 image, it works nrmaly, when i add one more picture, it breack up, had try to resize the slider or the slider figure img, kind of works but not totally, can you please explain if there's something that must be done either on the @keyframes or the size of the slider...?
@nourayoussouf4026
@nourayoussouf4026 3 года назад
Thanks you make it very easy
@RahulGupta-ki6mf
@RahulGupta-ki6mf 2 года назад
Thank you buddy.....
@PaperBeatproduction
@PaperBeatproduction 3 года назад
the animation: 20s slider infinite; code doesn't work. why is that. i have done other totus on slider but there is always a problem. i follow the text by the letter...
@wenceslol8183
@wenceslol8183 3 года назад
keep coding like hes doing in the video, mine was bugged as well until i added the entire code.
@kasumbaemmanuel9336
@kasumbaemmanuel9336 3 года назад
Is it possible for you to redo a video where you can put the slider into a container that has its own size
@excelamaefule5997
@excelamaefule5997 2 года назад
Please where did you get your high quality images
@oktoniuszevanyasimanungkal9554
@oktoniuszevanyasimanungkal9554 2 года назад
thank you!
@arnavgautam319
@arnavgautam319 2 года назад
The image slider is responsive and easy to learn, understand and compare the code (probably also great for sending a newbie friend as well)... but the images appear stacked... so the slider does not move even though all of them are 1280x720 pixels. Please HELP!!!
@hoang-vu99
@hoang-vu99 3 года назад
nice video
@gmeighteen4885
@gmeighteen4885 4 года назад
How to make the slider have a text above the slider , with condition of the text is not moving
@muzahub4260
@muzahub4260 2 года назад
i just had one problem it was not sliding like from 1 imige to 2 and from 2 to 3 it was like 1-3-withe picture-2-white picture and i dont had white picture anything eles is perfect if u can help me with this i will be so grateful
@donny533
@donny533 3 года назад
Awesome!
@christophpaulsteinlechner5074
@christophpaulsteinlechner5074 4 года назад
what about slider control buttons for next or previous image? or did i missed this.
@patriotact3729
@patriotact3729 3 года назад
No. You didn't miss it. Thanks for the video but the best manner to do slider with buttons control is Javascript.
@Shad0wB0X3r
@Shad0wB0X3r 3 года назад
@@patriotact3729 it is possible to add button control using only html and CSS but I agree that using JavaScript is a better approach. Christoph didn't miss anything. This image slider changes images automatically using animation and keyframes and therefore control buttons wasn't a part of this tutorial
@djziomsuper
@djziomsuper 2 года назад
i needed to do some adjustments but still really nice tutorial!!
@kosmickarma29
@kosmickarma29 6 лет назад
Good one!
@divinerlifestyle2484
@divinerlifestyle2484 2 года назад
why the last photo slide finish, but did not continue back to the first photo? Need for wait for some time only will repeat again
@stefansubotic1173
@stefansubotic1173 4 года назад
thanks you helped a lot
@SaraTarannum
@SaraTarannum 4 года назад
Thank u so much for this
@edward1412
@edward1412 4 года назад
#slider figure img { width :20; float: left; } It doesn't float to left when I get to this point. The size of my 5 images are 1750 by width and 1167 by height.
@AiriSenpai
@AiriSenpai 3 года назад
same!
@rajaramrawool3354
@rajaramrawool3354 3 года назад
width: 20 % ; not 20 another way is by using display:flex ;
@rakeshdebnath9679
@rakeshdebnath9679 3 года назад
yup.....it works...thnxxxx
@davennicholas9190
@davennicholas9190 3 года назад
yo thanks bro for this tutorial
@mzwakhechonco8403
@mzwakhechonco8403 2 года назад
Thank you so much...
@jasminejena8674
@jasminejena8674 5 лет назад
not able to push images to the left even if i type the exact code
@smile4560
@smile4560 4 года назад
Have same problem here.
@j0890
@j0890 4 года назад
@@smile4560 Same.........
@rajaryansharma6634
@rajaryansharma6634 4 года назад
sameeee
@uavlearning977
@uavlearning977 3 года назад
Display : Flex ;
@vamshichoula8248
@vamshichoula8248 3 года назад
you have solved now? iam also getting same problem
@AsianPro
@AsianPro 2 года назад
Thank u so much
@theotrg2371
@theotrg2371 Год назад
Hey, you tutorial is fantastic! But for my case, it is not working well. I want to add more than 4 images and once i add, let's say 5, the fifth one goes on a new line underneath the carousel. Could you give me a feedback on why is this happening?
@ashiqulislam7277
@ashiqulislam7277 5 лет назад
Great job..
@altagracia1659
@altagracia1659 4 года назад
hey it was an amazing tutorial compared to some other tutorial around where they won't share the css setting, but i mean seriously this one really helping me to finnish my homework but igot some problem here , the transition between image won't work that smooth, what should i do to fix that ? oh and btw i'm using 3 picture with the settings that you've been told on the comment section down bellow . Thanks^^ Greetings from Indonesia
@maheksota2219
@maheksota2219 3 года назад
having the same problem :// any solution?
@jacquelingonza9685
@jacquelingonza9685 2 года назад
best tutorial thanks
@TLopez341
@TLopez341 2 года назад
Thanks!
@TURKISTONIM2
@TURKISTONIM2 3 года назад
Thanks it works✔️✔️✔️✔️✔️
Далее
Top 10 CSS One Liners That Will Blow Your Mind
13:34
Просмотров 898 тыс.
Becoming A World-Record Holder 🔥
01:00
Просмотров 4 млн
How To Create An Image Slider In HTML, CSS & Javascript
24:42
HTML and CSS Project Tutorial: Pure CSS Image Slider
7:41
CSS Tips And Tricks I Wish I Knew Before
12:12
Просмотров 426 тыс.
CSS Slider: Image Slider with controls using CSS3 Only
9:50
Pure CSS Image Slider  Using Only HTML & CSS
7:39
Просмотров 164 тыс.
Create a horizontal media scroller with CSS
26:13
Просмотров 279 тыс.
Pure CSS Responsive Image Slider - Only HTML & CSS
9:20
How to create a Image slider using HTML and CSS
14:45
Просмотров 175 тыс.
Learn Flexbox CSS in 8 minutes
8:16
Просмотров 1,4 млн