HTML and CSS Project Tutorial: Pure CSS Image Slider

Поділитися
Вставка
  • Опубліковано 26 сер 2024

КОМЕНТАРІ • 232

  • @arsenedjumbe5914
    @arsenedjumbe5914 2 роки тому +64

    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  2 роки тому +2

      Thanks for the sub!

    • @whitesky8013
      @whitesky8013 Рік тому +3

      @@Skillthrive is there a way to make it move automatic?

    • @me-hu-ruhi
      @me-hu-ruhi 7 місяців тому

      ​@@whitesky8013yea using js

  • @glorysinkhonde197
    @glorysinkhonde197 Рік тому +49

    Best HTML/CSS carousel tutorial on UA-cam. The explanations are amazing!

  • @Skillthrive
    @Skillthrive  Рік тому +39

    I updated the CodePen to hide the scrollbar! Sorry I missed that in the tutorial.

    • @y01cu_yt
      @y01cu_yt Рік тому +2

      Thanks for the video. I think it'll be better if you pin this comment.

    • @duckpanther6768
      @duckpanther6768 11 місяців тому +1

      Idk if you’ll see this but is there an alternative for aspect ratio?

    • @mohamedftita9664
      @mohamedftita9664 10 місяців тому +3

      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 )

    • @TalalSaghir
      @TalalSaghir 2 місяці тому +1

      No problem

    • @juniorpeter3485
      @juniorpeter3485 27 днів тому

      Where is the video

  • @petrus2746
    @petrus2746 5 місяців тому +5

    Hats off to you man, I thought this could only be done with javascript

  • @antonioglavocevic3844
    @antonioglavocevic3844 5 місяців тому +6

    Extremely clean and simple example that is well explained.

  • @noahthegreat190
    @noahthegreat190 10 місяців тому +34

    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  10 місяців тому +1

      Thanks! That’s great to hear!

  • @andrecarcausto2740
    @andrecarcausto2740 Рік тому +14

    if you want to move the image inside the slider use object-position: 50% 50% (adjust this accordingly)

  • @Karmator
    @Karmator 4 місяці тому +4

    BEST TUTORIAL EVER. EASY TO FOLLOW AND SIMPLE. LOVE YOU MAN

  • @jimiperez2362
    @jimiperez2362 2 місяці тому +4

    Fix to hide horizontal scroll bar:
    .slider {
    display: flex;
    aspect-ratio: 16 / 11;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    box-shadow: 0 1.5rem 3rem -0.75rem hsla(0, 0%, 0%, 0.25);
    border-radius: 1rem;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    .slider::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
    }

  • @anthonychen7224
    @anthonychen7224 Рік тому +7

    Most helpful HTML/CSS tutorial I've seen so far.

  • @greenparksquad6336
    @greenparksquad6336 Місяць тому

    You're a great dev-youtuber. Able to explain and implement the feature so simply. I had completely different page structure and design but thanks to your guide I implemented slide so fast and easily. no tons of redudant code like in other guides

  • @juanmartinkuasnosky55
    @juanmartinkuasnosky55 Рік тому +5

    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!

  • @officersmiles9114
    @officersmiles9114 Рік тому +13

    Fantastic video! Spoken very clearly and everything explained in detail. A little fast, but still very good!

  • @chuk_udi
    @chuk_udi Рік тому +4

    Goated video. You can slap this bad boy anywhere

  • @6100poiuy
    @6100poiuy 11 місяців тому +5

    Just used this for one of my classes! Thank you!

  • @jo-iii
    @jo-iii 5 місяців тому +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.

  • @yokidrift1720
    @yokidrift1720 11 місяців тому +2

    With some modifications this will work well for me. Thanks for showing us the basic layout!

  • @naturesmusic1171
    @naturesmusic1171 2 роки тому +5

    Simple, short and clear

  • @TalalSaghir
    @TalalSaghir 2 місяці тому +1

    Bro, you solved my problem completely...............

  • @mind_blazed
    @mind_blazed Рік тому +3

    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 ..❤️❤️❤️

  • @svdden_strike
    @svdden_strike 4 місяці тому

    Best tutorial ever on the internet 😮🚀

  • @degubaertv
    @degubaertv 7 місяців тому +2

    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...

  • @themodernneeds1832
    @themodernneeds1832 11 місяців тому +3

    how to remove the horizontal slider below it....????

  • @raunak_saha
    @raunak_saha Рік тому +1

    Bro this guy is very very underrated

  • @justapoorliver3286
    @justapoorliver3286 11 місяців тому +1

    bro you save me and my friend from group project thankyou very much i love you!!

  • @nsa3679
    @nsa3679 Рік тому +3

    how to prevent the browser from centering top of viewport on the anchor target?

  • @olgakinasz8368
    @olgakinasz8368 Рік тому +5

    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.

  • @MrBumblebee
    @MrBumblebee Рік тому +5

    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 4 місяці тому

      hi! it seems that i have the same problem as you can you tell me how you fixed it
      pls

  • @RIZzKHAN-kp3vq
    @RIZzKHAN-kp3vq 11 місяців тому +2

    Easy to understand. Thanks👍

  • @Tech-tion55
    @Tech-tion55 3 місяці тому +1

    Did he use
    overflow:hidden; ???

  • @ozclips.official
    @ozclips.official 4 місяці тому

    when i click on next button to move image my scrollbar scroll down, why???

  • @chipyyyyy
    @chipyyyyy 8 місяців тому +1

    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.

  • @justkailash
    @justkailash Рік тому +2

    but in this tutorial .. the active slide is not showing in dots..

  • @Ali-rh4wl
    @Ali-rh4wl 10 місяців тому +1

    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  10 місяців тому

      Great, thanks for sharing! I'll have to try that out.

  • @user-uc8cp9ob1v
    @user-uc8cp9ob1v 9 місяців тому +2

    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)

  • @Hshdhxhdjsj
    @Hshdhxhdjsj 2 місяці тому

    How do you remove the slider bar at the bottom. It has the dots and the slider

  • @Badget007
    @Badget007 10 місяців тому +2

    I just want to ask. How are you able to hide the slider nav bar?

    • @Skillthrive
      @Skillthrive  10 місяців тому +1

      Nav bar? Do you mean scroll bar?

    • @domi_ka9153
      @domi_ka9153 10 місяців тому +1

      @@Skillthriveyes he means that, i have the same problem

  • @achmadfauzanaliffitrah
    @achmadfauzanaliffitrah 7 місяців тому +1

    and how to make this image auto move to left?

  • @minhphamcong7616
    @minhphamcong7616 Рік тому +2

    How to go to next slide with a tag without scrolling to the top ?? I am using . Nice video thank you.

    • @Em_..
      @Em_.. 7 місяців тому

      are that problem already fixed?

  • @evertonfonseca6017
    @evertonfonseca6017 Рік тому +1

    Amazing... Your didactic is perfect!

  • @DatsunZ73
    @DatsunZ73 2 роки тому +1

    This video was great and to the point thank you.

    • @Skillthrive
      @Skillthrive  2 роки тому

      You're welcome! Glad you found it useful.

  • @munizrobson5292
    @munizrobson5292 4 місяці тому +1

    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 4 місяці тому +3

      Bro disable the scroll-snap-align: start; and it will work with effect

    • @appleb-fu9nu
      @appleb-fu9nu День тому

      @@vivekraghuwanshi9756 tysm dawgg

    • @miloinacup7465
      @miloinacup7465 23 години тому

      @@vivekraghuwanshi9756 Thanks so much for this! Was stalking the comments to see if anyone found a fix.

  • @JTJaniceTek
    @JTJaniceTek 10 місяців тому +1

    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 10 місяців тому +2

      ok i've figured it out using overflow-x:hidden

    • @Skillthrive
      @Skillthrive  10 місяців тому

      Glad you got it!

  • @mugriciolacri1390
    @mugriciolacri1390 Рік тому +2

    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 7 місяців тому +1

      Hey there, have you found a solution to this yet? I'm having the same problem

  • @arturonicolasjuarez9175
    @arturonicolasjuarez9175 2 роки тому +1

    Thx! Very useful and easy to do! You are amazing!

  • @RipperTiger
    @RipperTiger 5 місяців тому

    thank you so much for the perfect tutorial

  • @dashakacreation
    @dashakacreation Рік тому

    Thanks for teaching... Good luck

  • @ezichichita2997
    @ezichichita2997 2 місяці тому

    I couldn't see the slider on my webpage and the scroll bar is still in mine

  • @HHcz
    @HHcz Рік тому +1

    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;
      }

  • @peridiusoverlord
    @peridiusoverlord 4 місяці тому

    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.

  • @umarmuzammil7332
    @umarmuzammil7332 4 місяці тому

    thank you bro helped a lot

  • @claudevonbrandis4772
    @claudevonbrandis4772 Рік тому +1

    Great Work , I dont know where to find codepen , I actually would just love to use those images

    • @Skillthrive
      @Skillthrive  Рік тому +1

      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.

  • @toonice555
    @toonice555 9 місяців тому

    Very clever using a tags!

  • @5Farron_pv
    @5Farron_pv Рік тому +2

    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  Рік тому

      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.

  • @fuadagayev-mg7fk
    @fuadagayev-mg7fk 8 місяців тому

    thank you. Very best and most important.

  • @JericJohnJuegos
    @JericJohnJuegos 3 місяці тому

    does anyone know how to remove the position change of the scroll bar after clicking the buttons? What happened to me was I added this to a wepage but it keeps on sliding back to the image itself. can anyone help me?

  • @kanna467_
    @kanna467_ Рік тому

    Thank you very much bro , very helpful content

  • @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?

  • @kasparkado7303
    @kasparkado7303 6 місяців тому

    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. :)

  • @kamdanibwp
    @kamdanibwp 7 місяців тому

    Jazak Allah o Khairaa

  • @Lollipop-gx8yy
    @Lollipop-gx8yy 11 місяців тому +1

    wow...its was smoooth

  • @niftyandy9152
    @niftyandy9152 Рік тому +1

    Your videos have been so helpful! Well done and thank you!

  • @harshwagh7016
    @harshwagh7016 7 місяців тому

    I have a problem that there is slider bar instead of these dots in the transition.

  • @ninguem9726
    @ninguem9726 9 місяців тому +1

    The tutorial was great. But there is a scroll bar under the slideshow how do i hide it?

    • @keithfrank7178
      @keithfrank7178 8 місяців тому +1

      I have the same problem. I've tried "overflow-x: hidden;" and it still doesn't work for me.

    • @boyoishere
      @boyoishere 7 місяців тому

      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

    • @anlesen1496
      @anlesen1496 2 дні тому

      @@keithfrank7178 .slider::-webkit-scrollbar {
      display: none; /* Safari and Chrome */
      }
      paste it to css

  • @abhisheksonar2378
    @abhisheksonar2378 Рік тому

    hey im working with photos of aspect ratio 4:3 what changes should i make ??

  • @mehdi.drkixxix
    @mehdi.drkixxix Рік тому +1

    is it possible to add a autoplay video in this slider ??

  • @yuganshmehta
    @yuganshmehta 11 місяців тому

    Sir when i click on anchor link button at bottom it opens image i have set there in new tab. What should i do?

  • @svdden_strike
    @svdden_strike 4 місяці тому +1

    How can I make it auto slide

  • @squaremale
    @squaremale 6 місяців тому

    Thanks! Question: why set position relative in .slider-wrapper if it's the default position value ?

    • @squaremale
      @squaremale 6 місяців тому

      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

  • @Trexvsunkasa
    @Trexvsunkasa 11 місяців тому +1

    Brilliant!

  • @Idk65789
    @Idk65789 4 місяці тому

    Help whenever i click on the switch slide button it scrolls

  • @typo7050
    @typo7050 8 місяців тому

    why there is a scrollbar under the image?

  • @joshuasinlao4164
    @joshuasinlao4164 7 місяців тому

    i have 3 images but it's skipping 1 images when I slide, any help?

  • @soyunaplanta7457
    @soyunaplanta7457 8 місяців тому

    When I use scroll the page slides down, what can I do?

  • @astnla
    @astnla 8 місяців тому

    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?

  • @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?

  • @usamongwilliam
    @usamongwilliam 11 місяців тому

    I wrapped the img in to direct and the img became zoomed in, can someone help me?

  • @Franciscorsilvaaa
    @Franciscorsilvaaa Рік тому +1

    I have no ideia why but when i click in the buttons my page kinda scrolls a bit down, if any 1 could help me o would apreciate it :)

    • @Skillthrive
      @Skillthrive  Рік тому

      Yeah, I discussed this on our Discord. It's because this uses anchor links. I found a solution someone posted for a similar project (at the bottom) markus.oberlehner.net/blog/super-simple-progressively-enhanced-carousel-with-css-scroll-snap/
      Unfortunately it looks like this solution isn't recommended because it uses "scrollIntoViewIfNeeded()" which is non-standard.
      If anyone knows a better solution for production, let me know!

    • @sofiamontero14
      @sofiamontero14 Рік тому

      @@Skillthrive "Unfortunately it looks like this solution isn't recommended because it uses "scrollIntoViewIfNeeded()" which is non-standard."
      where can I see this solution?

  • @ShadowAmitendu
    @ShadowAmitendu 2 роки тому +2

    You got a SUB

  • @Allformyequine
    @Allformyequine Рік тому +1

    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 Рік тому +4

      @@Skillthrive is there a way to make it loop but also keep the nav please?

  • @vxruzdanz
    @vxruzdanz 7 місяців тому

    so it works but i still have the default slide bar thing at the bottom? what could that mean?

  • @Titann39
    @Titann39 8 днів тому

    bro it's not smooth, whenever I click on button it instantly changes to next image. please help me make it smooth ---- btw loved your tutorials :)

  • @gamingtomusic7700
    @gamingtomusic7700 Рік тому +1

    I got a problem overflow-x: auto;
    Causes a scroll bar pls help

    • @Skillthrive
      @Skillthrive  Рік тому +1

      I updated the CodePen to remove the scrollbar! Checkout the "slider" and ".slider::-webkit-scrollbar" styles.

    • @gamingtomusic7700
      @gamingtomusic7700 Рік тому +1

      @@Skillthrive thanks for responding ❤💕💖

    • @gamingtomusic7700
      @gamingtomusic7700 Рік тому +1

      @@Skillthrive scroll bar disappears but it doesn't slide automatic over time but it works perfectly manual pls give some tip for autoplay the slide

    • @Skillthrive
      @Skillthrive  Рік тому +2

      @@gamingtomusic7700 You'll need to implement JavaScript to have an automatic sliding effect, but that falls outside the scope of this tutorial.

    • @gamingtomusic7700
      @gamingtomusic7700 Рік тому +1

      @@Skillthrive thank you❤🌹

  • @wolfie8748
    @wolfie8748 3 місяці тому

    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?

  • @ryaa0702
    @ryaa0702 Місяць тому

    how this section becomes full screen because it is to be used as a home page

  • @closedforester338
    @closedforester338 Рік тому

    how do I make whole thing stick to the Left side?

  • @jkviedeos8598
    @jkviedeos8598 Рік тому +1

    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 Рік тому +1

      @@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 Рік тому +3

      @@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 Рік тому +2

      You are right. It was happen to me too and still don't know the solution

  • @hayk9122
    @hayk9122 6 місяців тому

    Hey there, I'm using Notepad++ and the command "flex" isn't working. Could you please tell me how to fix it or the name of another free app I can use for html and CSS please?

  • @hariprasatht9082
    @hariprasatht9082 8 місяців тому

    keep up the good work

  • @zemitsu6246
    @zemitsu6246 6 місяців тому

    how about the color changing of the slider nav when it is on the pic

    • @zemitsu6246
      @zemitsu6246 6 місяців тому

      sorry bad grammar but pls can u understand

  • @ivonnea.462
    @ivonnea.462 Рік тому

    With this example, is it possible to crop the images when styling for smaller screens? How would it be?

    • @scoggo
      @scoggo Рік тому

      Hello friend, did you find an answer for this?

    • @ivonnea.462
      @ivonnea.462 Рік тому

      Not yet 😅

    • @hatesanti
      @hatesanti 6 місяців тому

      adjust aspect ratio

  • @ustllys
    @ustllys 2 роки тому +1

    Thank you

  • @charbelmoussawer2107
    @charbelmoussawer2107 7 місяців тому

    How do i get rid of the scroll bar. I don't know about his screen but on mine it appears white and is very obvious.

  • @rdzn.noccio9867
    @rdzn.noccio9867 5 місяців тому

    how is it possible that i can't see the animations?

  • @NetherFrog
    @NetherFrog 8 місяців тому

    Usefull and W video bro

  • @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();
      }
      });

  • @JoseCynonQLuna
    @JoseCynonQLuna Рік тому +1

    I want it to auto slide, how do i do that? Great video btw well deserve a sub

  • @nav_narrativas
    @nav_narrativas 3 місяці тому

    i copied the code but my buttons dont work:(

  • @MZGAMEZZ
    @MZGAMEZZ 8 місяців тому

    Bro how do you hide the scroll bar mines the scroll bar I want it to be like circles like yours

    • @boyoishere
      @boyoishere 7 місяців тому

      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) */
      }

  • @andrewmurrie1538
    @andrewmurrie1538 Рік тому

    great video thanks