Тёмный

HTML and CSS Project Tutorial: Pure CSS Image Slider 

Skillthrive
Подписаться 73 тыс.
Просмотров 250 тыс.
50% 1

Let's walk through this HTML and CSS tutorial to create a responsive image slider with only HTML and CSS!
🗂 CODE: skillthrive.gumroad.com/l/cgybb
⏰ TIMESTAMPS ⏰
Introduction: 0:00
HTML: 0:21
CSS: 1:35
🔗 HELPFUL RESOURCES 🔗
A Complete Guide to Links and Buttons:
css-tricks.com/a-complete-gui...
A Complete Guide to Flexbox:
css-tricks.com/snippets/css/a...
❤️ INSPIRATION ❤️
Emilio Dominguez: codepen.io/emilio-dominguez/p...
🥰 FOLLOW ME 🥰
Twitter: / hunterbecton
👋 FOLLOW SKILLTHRIVE 👋
Twitter: / skillthrive
#html #css #coding

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

 

20 май 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 211   
@glorysinkhonde197
@glorysinkhonde197 Год назад
Best HTML/CSS carousel tutorial on RU-vid. The explanations are amazing!
@noahthegreat190
@noahthegreat190 7 месяцев назад
bro wtf i think this is the best coding tutorial ive ever seen (and i spent 5 years @ CS in Uni). Clean and concise english and explanation, less than 10 min, and good audio. W channel
@Skillthrive
@Skillthrive 6 месяцев назад
Thanks! That’s great to hear!
@Karmator
@Karmator Месяц назад
BEST TUTORIAL EVER. EASY TO FOLLOW AND SIMPLE. LOVE YOU MAN
@andrecarcausto2740
@andrecarcausto2740 10 месяцев назад
if you want to move the image inside the slider use object-position: 50% 50% (adjust this accordingly)
@arsenedjumbe5914
@arsenedjumbe5914 Год назад
I couldn't believe that with just HTML and CSS something like this could have been achieved Man, you've just earned a subscription Great content 👍🏾
@Skillthrive
@Skillthrive Год назад
Thanks for the sub!
@whitesky8013
@whitesky8013 Год назад
@@Skillthrive is there a way to make it move automatic?
@me-hu-ruhi
@me-hu-ruhi 4 месяца назад
​@@whitesky8013yea using js
@antonioglavocevic3844
@antonioglavocevic3844 Месяц назад
Extremely clean and simple example that is well explained.
@petrus2746
@petrus2746 2 месяца назад
Hats off to you man, I thought this could only be done with javascript
@chuk_udi
@chuk_udi 9 месяцев назад
Goated video. You can slap this bad boy anywhere
@anthonychen7224
@anthonychen7224 Год назад
Most helpful HTML/CSS tutorial I've seen so far.
@Skillthrive
@Skillthrive Год назад
Glad you enjoyed it!
@Skillthrive
@Skillthrive Год назад
I updated the CodePen to hide the scrollbar! Sorry I missed that in the tutorial.
@y01cu_yt
@y01cu_yt 9 месяцев назад
Thanks for the video. I think it'll be better if you pin this comment.
@duckpanther6768
@duckpanther6768 8 месяцев назад
Idk if you’ll see this but is there an alternative for aspect ratio?
@mohamedftita9664
@mohamedftita9664 6 месяцев назад
Hi thnks for the awesome tutorial . There is a tiny detail I wanna tell you about if you use this method in a full website it will always take the user back to this section (when the user scrolled down to see the other section )
@Trexvsunkasa
@Trexvsunkasa 8 месяцев назад
Brilliant!
@officersmiles9114
@officersmiles9114 11 месяцев назад
Fantastic video! Spoken very clearly and everything explained in detail. A little fast, but still very good!
@tailus-dev6269
@tailus-dev6269 10 месяцев назад
kurisutina
@6100poiuy
@6100poiuy 8 месяцев назад
Just used this for one of my classes! Thank you!
@Skillthrive
@Skillthrive 7 месяцев назад
You're very welcome!
@juanmartinkuasnosky55
@juanmartinkuasnosky55 Год назад
u are like a god dude, you have just earned a subscription from Argentina! great videos, keep going!
@Skillthrive
@Skillthrive Год назад
Thanks, Juan! Glad to have your sub!
@svdden_strike
@svdden_strike 24 дня назад
Best tutorial ever on the internet 😮🚀
@mind_blazed
@mind_blazed Год назад
How simply simplified man . This is best video . Thank you very much .Best explanation 🔥❤️
@Skillthrive
@Skillthrive Год назад
Thanks, Pravin! Glad you found it helpful.
@mind_blazed
@mind_blazed Год назад
@@Skillthrive not even slider but also many css property like scroll type flex 10 100%; object fit cover ....it helps me a lot ..❤️❤️❤️
@yokidrift1720
@yokidrift1720 8 месяцев назад
With some modifications this will work well for me. Thanks for showing us the basic layout!
@Skillthrive
@Skillthrive 7 месяцев назад
Glad it was helpful!
@kanna467_
@kanna467_ 9 месяцев назад
Thank you very much bro , very helpful content
@RIZzKHAN-kp3vq
@RIZzKHAN-kp3vq 8 месяцев назад
Easy to understand. Thanks👍
@Skillthrive
@Skillthrive 7 месяцев назад
Glad it helped!
@RipperTiger
@RipperTiger 2 месяца назад
thank you so much for the perfect tutorial
@dashakacreation
@dashakacreation 8 месяцев назад
Thanks for teaching... Good luck
@naturesmusic1171
@naturesmusic1171 Год назад
Simple, short and clear
@Skillthrive
@Skillthrive Год назад
Thanks, Andre.
@nsa3679
@nsa3679 9 месяцев назад
how to prevent the browser from centering top of viewport on the anchor target?
@fuadagayev-mg7fk
@fuadagayev-mg7fk 4 месяца назад
thank you. Very best and most important.
@umarmuzammil7332
@umarmuzammil7332 23 дня назад
thank you bro helped a lot
@eduargalvan7123
@eduargalvan7123 8 месяцев назад
muchisimas gracias
@Lollipop-gx8yy
@Lollipop-gx8yy 8 месяцев назад
wow...its was smoooth
@mehdi.drkixxix
@mehdi.drkixxix 9 месяцев назад
is it possible to add a autoplay video in this slider ??
@yuganshmehta
@yuganshmehta 8 месяцев назад
Sir when i click on anchor link button at bottom it opens image i have set there in new tab. What should i do?
@kamdanibwp
@kamdanibwp 4 месяца назад
Jazak Allah o Khairaa
@olgakinasz8368
@olgakinasz8368 Год назад
Amazing tutorial!!! The one I really could use that perfectly works for my project! Many thanks!!!!
@Skillthrive
@Skillthrive Год назад
Thank you! I'm glad it worked for you.
@justapoorliver3286
@justapoorliver3286 8 месяцев назад
bro you save me and my friend from group project thankyou very much i love you!!
@Skillthrive
@Skillthrive 7 месяцев назад
You are welcome
@DatsunZ73
@DatsunZ73 Год назад
This video was great and to the point thank you.
@Skillthrive
@Skillthrive Год назад
You're welcome! Glad you found it useful.
@arturonicolasjuarez9175
@arturonicolasjuarez9175 Год назад
Thx! Very useful and easy to do! You are amazing!
@Skillthrive
@Skillthrive Год назад
Glad you enjoyed it, Arturo!
@Human_Evolution-
@Human_Evolution- Год назад
Well done. I need this only for .mobile, and when on desktop I need to retain the image collage I've created. Any tips?
@themodernneeds1832
@themodernneeds1832 8 месяцев назад
how to remove the horizontal slider below it....????
@melodia6875
@melodia6875 9 месяцев назад
Subscribed
@letshigh99
@letshigh99 2 месяца назад
how to hide a scroll bar? why is it hidden in your video by default???
@abhisheksonar2378
@abhisheksonar2378 10 месяцев назад
hey im working with photos of aspect ratio 4:3 what changes should i make ??
@evertonfonseca6017
@evertonfonseca6017 Год назад
Amazing... Your didactic is perfect!
@Skillthrive
@Skillthrive Год назад
Thank you!
@slowedrelaxed
@slowedrelaxed 5 месяцев назад
You Got a new Subscriber bro🙂
@degubaertv
@degubaertv 3 месяца назад
How can i prevent Jumping on Click at the Dots? It always jumps up, till the slider reaches the top. and that everytime i click a Dot...
@kasparkado7303
@kasparkado7303 3 месяца назад
Thank you for this tutorial! It almost works for me, the only problem is that I can't see the dots and the slider only works with arrows, not with cursor. I did everything the way you did, except I have a header with a navigation bar in my project. Any solution for this? I'm an absolute beginner, it's my 1st week of coding. :)
@niftyandy9152
@niftyandy9152 Год назад
Your videos have been so helpful! Well done and thank you!
@Skillthrive
@Skillthrive Год назад
Glad I could help! Thank you!
@andrewmurrie1538
@andrewmurrie1538 Год назад
great video thanks
@NetherFrog
@NetherFrog 4 месяца назад
Usefull and W video bro
@usamongwilliam
@usamongwilliam 8 месяцев назад
I wrapped the img in to direct and the img became zoomed in, can someone help me?
@hariprasatht9082
@hariprasatht9082 5 месяцев назад
keep up the good work
@chipyyyyy
@chipyyyyy 4 месяца назад
How can i make that when i click any of the buttons it moves the page and puts the images in the top of the users view, i mean when i click if i've scrolled down it puts me up again, i don't know if someone could help me please, thanks.
@EmrrysRoyce
@EmrrysRoyce 8 месяцев назад
You didn’t link the css, how did you do it?
@Ali-rh4wl
@Ali-rh4wl 7 месяцев назад
Thanks for the content. But there is no need to use transiton. If you just add the scroll-behaviour:smooth to parent of pages. It works. Can you do it with just transition, not scroll behaviour.
@Skillthrive
@Skillthrive 7 месяцев назад
Great, thanks for sharing! I'll have to try that out.
@emileguiza8698
@emileguiza8698 Год назад
I have a problem, only two of the three images that I used appear and a slider bar continues to appear below the three dots, what can i do?
@raunak_saha
@raunak_saha Год назад
Bro this guy is very very underrated
@Skillthrive
@Skillthrive Год назад
Thank you!
@peridiusoverlord
@peridiusoverlord Месяц назад
Hey, I can't figure out how to navigate to your CodePen page. I'm trying to reference your work properly in an APA format document.
@squaremale
@squaremale 3 месяца назад
Thanks! Question: why set position relative in .slider-wrapper if it's the default position value ?
@squaremale
@squaremale 3 месяца назад
Actually, the default position property is static. The reason .slider-wrapper position is set to relative is to make .slider-nav relative to .slider-wrapper when using the left property
@wolfie8748
@wolfie8748 13 дней назад
Can I make these images responsive ? as In I want to put my personal projects so recruiter can click on them and go to another link?
@toonice555
@toonice555 5 месяцев назад
Very clever using a tags!
@Skillthrive
@Skillthrive 5 месяцев назад
Thank you! 😊
@astnla
@astnla 5 месяцев назад
I love this one! Just one question, is there anyway to make it slide by itself instead of having to click it, or will that require JS?
@jonasgarnier492
@jonasgarnier492 4 месяца назад
yes it requires java script
@Allformyequine
@Allformyequine Год назад
So with this will the images slide automatically? Or do you have to use the nav to move them? Thank you great stuff here!
@Skillthrive
@Skillthrive Год назад
You have to use the nav bc this is basically a hacky way using CSS and anchor links.
@sushibali6522
@sushibali6522 Год назад
@@Skillthrive is there a way to make it loop but also keep the nav please?
@jo-iii
@jo-iii 2 месяца назад
While it may not be visible in codepen, setting `overflow-x` to `auto` will show a scrollbar beneath. It was mentioned but never brought up again. Setting it to `hidden` will match the same output in a browser.
@ustllys
@ustllys Год назад
Thank you
@Skillthrive
@Skillthrive Год назад
You're welcome! 🤣
@claudevonbrandis4772
@claudevonbrandis4772 Год назад
Great Work , I dont know where to find codepen , I actually would just love to use those images
@Skillthrive
@Skillthrive Год назад
Thank you! It’s the Gumroad link in the description. You can pay what you want and it will redirect you to the CodePen. The images are from Unsplash.
@Tech-tion55
@Tech-tion55 2 дня назад
Did he use overflow:hidden; ???
@justkailash
@justkailash Год назад
will this work in all browser... ?
@ShadowAmitendu
@ShadowAmitendu Год назад
You got a SUB
@Skillthrive
@Skillthrive Год назад
Glad to have ya!
@MrBumblebee
@MrBumblebee 10 месяцев назад
If i were scrolled down the window and clicked the href button , it seems that it takes me to the top of the window where the image slider is located.Is there a way to fixx that? other than that , the video is really cool.
@FLujb
@FLujb 24 дня назад
hi! it seems that i have the same problem as you can you tell me how you fixed it pls
@codingandEnglishlearning
@codingandEnglishlearning Год назад
Great information. Nice video. Subscribed the channel
@Skillthrive
@Skillthrive Год назад
Glad to have you!
@user-uc8cp9ob1v
@user-uc8cp9ob1v 5 месяцев назад
Is there a way to let the picture transition it automatically - but only, if the user does not hover or click on the slider for a minute? (only html and css)
@boothecuteghost7053
@boothecuteghost7053 5 месяцев назад
You can use animation for that
@armaanbrar6406
@armaanbrar6406 Год назад
Nice explanation. How can I add arrows to the html or a swipe feature instead of the dots
@Skillthrive
@Skillthrive Год назад
You’ll need to bring in JavaScript. It will need to track how many images you have and then calculate the end/beginning depending on which image is active.
@mugriciolacri1390
@mugriciolacri1390 8 месяцев назад
Thanks for the tutorial. It works, but when i click on the dots and the images slide, the page scrolls down. I also tried your code and the same thing happens. This method doesn't seem viable.
@boyoishere
@boyoishere 4 месяца назад
Hey there, have you found a solution to this yet? I'm having the same problem
@closedforester338
@closedforester338 Год назад
how do I make whole thing stick to the Left side?
@achmadfauzanaliffitrah
@achmadfauzanaliffitrah 4 месяца назад
and how to make this image auto move to left?
@user-jd2rs8iw1g
@user-jd2rs8iw1g 10 месяцев назад
does this work for text to?
@Idk65789
@Idk65789 Месяц назад
Help whenever i click on the switch slide button it scrolls
@5Farron_pv
@5Farron_pv 10 месяцев назад
great video ! I have a problem, i added your image slider into my page which has many images that you can scroll down, when i click on the anchor link, my page teleport himself into the image in the slider, how can I avoid that ? :(
@Skillthrive
@Skillthrive 10 месяцев назад
Thank you! Unfortunately it’s a bit hacky considering that’s the default behavior of anchor links. 😔 I should’ve been more clear about that, but I’ve shared some info in the comments about some work arounds.
@justkailash
@justkailash 10 месяцев назад
but in this tutorial .. the active slide is not showing in dots..
@melvinwi651
@melvinwi651 6 месяцев назад
GOOD
@munizrobson5292
@munizrobson5292 28 дней назад
Hey guys are the LINKS working for you? I mean, the arrows is ok, but when I click in the 3 dotes, it goes straight to the image without any effect at all
@vivekraghuwanshi9756
@vivekraghuwanshi9756 24 дня назад
Bro disable the scroll-snap-align: start; and it will work with effect
@soyunaplanta7457
@soyunaplanta7457 5 месяцев назад
When I use scroll the page slides down, what can I do?
@minhphamcong7616
@minhphamcong7616 Год назад
How to go to next slide with a tag without scrolling to the top ?? I am using . Nice video thank you.
@Em_..
@Em_.. 3 месяца назад
are that problem already fixed?
@ozclips.official
@ozclips.official 27 дней назад
when i click on next button to move image my scrollbar scroll down, why???
@jkviedeos8598
@jkviedeos8598 Год назад
Your tutorial was extremely helpful. Thank you. I have the problem, that, whenever i click on the nav buttons, the page jumps down, so that the image slider comes to the upmost top of the slider and i'm really not sure why. Do you have any idea?
@Skillthrive
@Skillthrive Год назад
Thank you! Glad you found it helpful. As for your problem, it sounds like you have something wrong with the anchor links. Also just double check your html.
@jkviedeos8598
@jkviedeos8598 Год назад
@@Skillthrive Hello, thank you for your fast response. So, i checked the HTML and the CSS and found nothing, that i would be aware could cause something like that. So i made a test html-file, linked it to another test css-file and copied all of your code exactly as it is. Then, for test purposes i created a div, with the class "Titel" and in the css i gave it the value "padding-top:30%;"; so that i have something above to control, if the page is still skiping. And yes, it actually is. It also happens in your CodePen, if you shrink down the sites size. I should note, that i'm using firefox.
@Skillthrive
@Skillthrive Год назад
Hey, sorry for the late reply. For some reason your comment was flagged for review. Anyways, I looked into the issue and could only get it with Firefox developer edition. For some reason "aspect-ratio" is considered an invalid property. In the latest Firefox everything worked as expected.
@markf8639
@markf8639 Год назад
@@Skillthrive I think what is being suggested here is that on click, due to default browser behavior the browser is scrolling/jumping to the #(id) being clicked, as it should do with an internally linked href. Its happening on every browser i have tested.
@aaw9004
@aaw9004 Год назад
You are right. It was happen to me too and still don't know the solution
@ivonnea.462
@ivonnea.462 10 месяцев назад
With this example, is it possible to crop the images when styling for smaller screens? How would it be?
@scoggo
@scoggo 10 месяцев назад
Hello friend, did you find an answer for this?
@ivonnea.462
@ivonnea.462 10 месяцев назад
Not yet 😅
@santiiug
@santiiug 3 месяца назад
adjust aspect ratio
@harshwagh7016
@harshwagh7016 4 месяца назад
I have a problem that there is slider bar instead of these dots in the transition.
@JTJaniceTek
@JTJaniceTek 7 месяцев назад
how do i remove the scrollbar which allows me to scroll to the left and right (below the buttons)? let's say i just want to press the buttons in order to slide
@JTJaniceTek
@JTJaniceTek 7 месяцев назад
ok i've figured it out using overflow-x:hidden
@Skillthrive
@Skillthrive 7 месяцев назад
Glad you got it!
@joshuasinlao4164
@joshuasinlao4164 4 месяца назад
i have 3 images but it's skipping 1 images when I slide, any help?
@JeanRomanRoaming
@JeanRomanRoaming Год назад
This slider is great - however I am having trouble because the slider container jerks up under my menu navbar when the slide changes. Any idea how to fix this to make the slider container NEVER jerk up under the navbar???
@Skillthrive
@Skillthrive Год назад
It’s because this is a “hack” that uses anchor tags to achieve the effect. Unfortunately, a side effect is the issue you’re running into. I covered this issue on our Discord, but this guy covered a solution in this post: markus.oberlehner.net/blog/super-simple-progressively-enhanced-carousel-with-css-scroll-snap/ However, the method he uses isn’t recommend by Mozilla: developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded
@JeanRomanRoaming
@JeanRomanRoaming Год назад
​@@Skillthrive Thank you for the response. I've read thru the links but I am unsure about how to implement the solution. I am a novice. Your help is much appreciated. Where Do I insert the code? Do I need a seperate .js file? or where do I insert - the code - it into my html or css? files ? do I insert in under: section class="container-slider" or div class="slider-wrapper", or div class="slider", or img id="slide-1". ???? THE CODE: document.querySelector('#controls').addEventListener('click', (event) => { const $slide = document.querySelector(event.target.getAttribute('href')); if (!$slide) return; if ($slide.scrollIntoViewIfNeeded) { event.preventDefault(); $slide.scrollIntoViewIfNeeded(); } else if ($slide.scrollIntoView) { event.preventDefault(); $slide.scrollIntoView(); } });
@Badget007
@Badget007 7 месяцев назад
I just want to ask. How are you able to hide the slider nav bar?
@Skillthrive
@Skillthrive 7 месяцев назад
Nav bar? Do you mean scroll bar?
@domi_ka9153
@domi_ka9153 6 месяцев назад
@@Skillthriveyes he means that, i have the same problem
@HHcz
@HHcz Год назад
The whole thing works perfectly fine but there's a horizontal scroll bar that appears at the bottom. How do I get rid of it? edit: I changed the overflow-x to hidden and it solved it sooo why did we need to keep it at auto?
@Skillthrive
@Skillthrive Год назад
So we could retain the scroll behavior. The codepen should have updated code that hides the scroll bar.
@HHcz
@HHcz Год назад
@@Skillthrive btw everytime I click on the dots to switch between pictures the whole page moves to a position where the container is positioned on the top. How do I make it so that it doesn't move me around?
@kossylazy2730
@kossylazy2730 Год назад
U can keep it and add overflow property and set it to hidden Overflow : hidden ; that did the job for me at least
@moonlightgirl2332
@moonlightgirl2332 Год назад
.slider::-webkit-scrollbar { display: none; }
@typo7050
@typo7050 5 месяцев назад
why there is a scrollbar under the image?
@svdden_strike
@svdden_strike 24 дня назад
How can I make it auto slide
@ALPHA-vu7im
@ALPHA-vu7im 11 месяцев назад
mata meka loku karana widiha kiyannako??
@manuelcastro6307
@manuelcastro6307 Год назад
HIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII Pls help me how do i resize the images because idk how to do it and this is for my computer subject HEHE thank u
@Vivek-up9st
@Vivek-up9st 9 месяцев назад
my hovers are not working please help me
@user-ub9oc6dz3w
@user-ub9oc6dz3w 7 месяцев назад
Can we make it automatic without JAvaScript?
@Skillthrive
@Skillthrive 7 месяцев назад
You could probably use CSS animations, but I’ve never given it a shot. I’d probably use JS for that.
@JoseCynonQLuna
@JoseCynonQLuna Год назад
I want it to auto slide, how do i do that? Great video btw well deserve a sub
@sofiamontero14
@sofiamontero14 11 месяцев назад
javaScript
@bobakid2661
@bobakid2661 8 месяцев назад
My images isnt showing
@ninguem9726
@ninguem9726 6 месяцев назад
The tutorial was great. But there is a scroll bar under the slideshow how do i hide it?
@keithfrank7178
@keithfrank7178 5 месяцев назад
I have the same problem. I've tried "overflow-x: hidden;" and it still doesn't work for me.
@boyoishere
@boyoishere 4 месяца назад
it depends on the browser, but you can add this to ur CSS code. It worked for me: .slider { scrollbar-width: none; /* Firefox */ -ms-overflow-style: none; /* Internet Explorer and Microsoft Edge */ } .slider::-webkit-scrollbar { display: none; /* WebKit (Safari and Chrome) */ }@@keithfrank7178
@MZGAMEZZ
@MZGAMEZZ 5 месяцев назад
Bro how do you hide the scroll bar mines the scroll bar I want it to be like circles like yours
@boyoishere
@boyoishere 4 месяца назад
it depends on the browser, but you can add this to ur CSS code. It worked for me: .slider { scrollbar-width: none; /* Firefox */ -ms-overflow-style: none; /* Internet Explorer and Microsoft Edge */ } .slider::-webkit-scrollbar { display: none; /* WebKit (Safari and Chrome) */ }
@zemitsu6246
@zemitsu6246 3 месяца назад
how about the color changing of the slider nav when it is on the pic
@zemitsu6246
@zemitsu6246 3 месяца назад
sorry bad grammar but pls can u understand
Далее
How the CSS Box Model Works in 2 Minutes
2:13
Просмотров 15 тыс.
Build a JavaScript IMAGE SLIDER in 15 minutes! 🖼️
15:49
КАХА и Джин 2
00:36
Просмотров 913 тыс.
Pure CSS Image Slider  Using Only HTML & CSS
7:39
Просмотров 162 тыс.
Subtle, yet Beautiful Scroll Animations
5:04
Просмотров 1,5 млн
Learn CSS Flexbox in 6 Minutes
6:04
Просмотров 26 тыс.
CSS Tips And Tricks I Wish I Knew Before
12:12
Просмотров 404 тыс.
Auto Image Slideshow using HTML and CSS
7:03
Просмотров 319 тыс.
Responsive Slider Using HTML & CSS Only
10:34
Просмотров 227 тыс.
КАХА и Джин 2
00:36
Просмотров 913 тыс.