Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>image slider</title>
    <link href=""

            width: 100vw;
            height: 100vh;
            display: flex;
            width: 80%;
            height: 500px;
            border-radius: 25px;
            margin: 5px auto;
            box-shadow: 0 0 15px black;
            transition: all 0.5s ease-in;
            font-size: 50px;
            position: relative;
            top: 225px;
            border-radius: 30px;
            background-color: rgba(158, 170, 170, 0.541);
            height: 50px;
            padding: 5px;
            color: rgb(66, 65, 65);
            box-shadow: 0 0 15px black;
            cursor: pointer;
            user-select: none;

            left: 5%;
            background-color: rgba(28, 207, 207, 0.541);
            right: 5%;
            background-color: rgba(28, 207, 207, 0.541);

    <div class="image-slider">
        <span class="material-icons-outlined back">
            <img class="image-holder" src="" alt="">
        <span class="material-icons-outlined forward">
    let holder = document.querySelector('.image-holder');
    let forward = document.querySelector('.forward');
    let back = document.querySelector('.back');

// Lets make array of images
    let img_arr = [

    let image_count = 0;

    // Function to increase image count
    const imageIncrease = ()=>{
        holder.src = img_arr[image_count]
        // console.log(image_count)
        // console.log(img_arr.length)
              if (image_count >= img_arr.length-1){
            image_count = 0;
            image_count ++;
    // function to decrease image count
    const imageDecrease = ()=>{
        holder.src = img_arr[image_count]
        // console.log(image_count)
        if (image_count === 0){
            image_count = img_arr.length-1;
            image_count --;