Why my slider is not working?

Works perfectly if i seperate the HTML/CSS div/slider from the rest of the code.
https://codepen.io/ricardonothing/pen/ExYomQp?editors=1100

Could you explain what is not working? Are you trying to create a slide show? Like this:
https://www.w3schools.com/howto/howto_js_slideshow.asp
Or something else?

Could you read the code?.
i want to do a slider without JS.

I did, not sure what you meant, that is why I asked for clarification on what you are trying to do. So, another guess. Do you want one pic at a time shown and for people to swipe sideways on the pic to see the next pic? If you comment out this that is what the result would be

img {
    max-width: 100%;
    display: block;
    height: auto;
    margin: 0 auto;
}