Header Ads

Breaking News
recent

CSS Accordion Slider

Horizontal accordion slider

Vertical accordion slider

Number of decks: 4
Gap size: 1px
Title width: 40px
Title height: px
Title font size: 15px
Content width: 700px
Content height: 290px
Border radius: 8px
Border size: 0px
  • How it works?

    • Play the css settings above, change colors, deck count, slider dimensions etc.
    • When you are happy with the final result, click "Get Html Code" and copy generated code.
    • The generated accordion slider is pure CSS and HTML and there is no JavaScript.
    • The slider can be used as a gallery, product tour, portfolio showcase, content slider etc.
    • This is a free tool and all the code you generate can be used without any license issues.
    • Supports Chrome 4+, Safari 4+, Opera 10.5+, Firefox 4+ and IE9+.
    • Feel free to drop a comment if you have any more questions.
  • Tips

    • Add a "class name" for each accordion to support pages that have multiple different accordions.
    • You can also make an accordion menu. Just include a menu structure in content section.
    • Don't restrict yourself with flat colors. Use css shadows or gradients to make the accordion more attractive.
  • Get CSS Code

                        
    .accordion {
        -webkit-box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
        -moz-box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
        box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
        font-family: Arial, Helvetica, sans-serif;
        border-color: #2e091b;
        border-style: solid;
        border-width: 0px;
        border-radius: 8px;
        margin: 0 auto;
        height: 290px;
        width: 864px;
    }
    
    .accordion > ul > li,
    .accordion-title,
    .accordion-content,
    .accordion-separator {
        float: left;
    }
    
    .accordion > ul > li {
        background-color: #5c1738;
        margin-right: -700px;
        margin-bottom: -0px;
    }
    
    .accordion-select:checked ~ .accordion-separator {
        margin-right: 700px;
        margin-bottom: 0px;
    }
    
    .accordion-title,
    .accordion-select  {
        background-color: #7f204e;
        color: #ffffff;
        width: 40px;
        height: 290px;
        font-size: 15px;
    }
    
    .accordion-title span {
        margin-bottom: 20px; 
        margin-left: 20px;
    }
    
    .accordion-select:hover ~ .accordion-title,
    .accordion-select:checked ~ .accordion-title {
        background-color: #e80974;
    }
    
    .accordion-title span  { 
        transform: rotate(-90deg);
        -o-transform: rotate(-90deg);
        -moz-transform: rotate(-90deg);
        -webkit-transform: rotate(-90deg);
        -ms-writing-mode: lr-bt;
        filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
        margin-left: 0px;
        line-height: 40px;
    }
    
    .accordion-content {
        background-color: #461233;
        color: #d1a6c5;
        height: 234px;
        width: 644px;
        padding: 28px;
    }
    
    .accordion-title,
    .accordion-select:checked ~ .accordion-content {
        margin-right: 1px;
        margin-bottom: 1px;
    }
    
    /* Do not change following properties, they aren't 
    generated automatically and are common for each slider. */
    .accordion {
        overflow: hidden;
    }
    
    .accordion > ul {
        margin: 0;
        padding: 0;
        list-style: none;
        width: 101%;
    }
    
    .accordion > ul > li,
    .accordion-title {
        position: relative;
    }
    
    .accordion-select {
        cursor: pointer;
        position: absolute;
        opacity: 0;
        top: 0;
        left: 0;
        margin: 0;
        z-index: 1;
    }
    
    .accordion-title span {
        display: block;
        position: absolute;
        bottom: 0px;
        width: 100%;
        white-space: nowrap;
    }
    
    .accordion-content {
        position: relative;
        overflow: auto;
    }
    
    .accordion-separator {
        transition: margin 0.3s ease 0.1s;
        -o-transition: margin 0.3s ease 0.1s;
        -moz-transition: margin 0.3s ease 0.1s;
        -webkit-transition: margin 0.3s ease 0.1s;
    }
                    
  • Get HTML Code

                        
    <!DOCTYPE html>
    <html>
    <head>
    <title>CSS Accordion Slider</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
    .accordion {
        -webkit-box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
        -moz-box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
        box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
        font-family: Arial, Helvetica, sans-serif;
        border-color: #2e091b;
        border-style: solid;
        border-width: 0px;
        border-radius: 8px;
        margin: 0 auto;
        height: 290px;
        width: 864px;
    }
    
    .accordion > ul > li,
    .accordion-title,
    .accordion-content,
    .accordion-separator {
        float: left;
    }
    
    .accordion > ul > li {
        background-color: #5c1738;
        margin-right: -700px;
        margin-bottom: -0px;
    }
    
    .accordion-select:checked ~ .accordion-separator {
        margin-right: 700px;
        margin-bottom: 0px;
    }
    
    .accordion-title,
    .accordion-select  {
        background-color: #7f204e;
        color: #ffffff;
        width: 40px;
        height: 290px;
        font-size: 15px;
    }
    
    .accordion-title span {
        margin-bottom: 20px; 
        margin-left: 20px;
    }
    
    .accordion-select:hover ~ .accordion-title,
    .accordion-select:checked ~ .accordion-title {
        background-color: #e80974;
    }
    
    .accordion-title span  { 
        transform: rotate(-90deg);
        -o-transform: rotate(-90deg);
        -moz-transform: rotate(-90deg);
        -webkit-transform: rotate(-90deg);
        -ms-writing-mode: lr-bt;
        filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
        margin-left: 0px;
        line-height: 40px;
    }
    
    .accordion-content {
        background-color: #461233;
        color: #d1a6c5;
        height: 234px;
        width: 644px;
        padding: 28px;
    }
    
    .accordion-title,
    .accordion-select:checked ~ .accordion-content {
        margin-right: 1px;
        margin-bottom: 1px;
    }
    
    /* Do not change following properties, they aren't 
    generated automatically and are common for each slider. */
    .accordion {
        overflow: hidden;
    }
    
    .accordion > ul {
        margin: 0;
        padding: 0;
        list-style: none;
        width: 101%;
    }
    
    .accordion > ul > li,
    .accordion-title {
        position: relative;
    }
    
    .accordion-select {
        cursor: pointer;
        position: absolute;
        opacity: 0;
        top: 0;
        left: 0;
        margin: 0;
        z-index: 1;
    }
    
    .accordion-title span {
        display: block;
        position: absolute;
        bottom: 0px;
        width: 100%;
        white-space: nowrap;
    }
    
    .accordion-content {
        position: relative;
        overflow: auto;
    }
    
    .accordion-separator {
        transition: margin 0.3s ease 0.1s;
        -o-transition: margin 0.3s ease 0.1s;
        -moz-transition: margin 0.3s ease 0.1s;
        -webkit-transition: margin 0.3s ease 0.1s;
    }
    </style>
    </head>
    <body>
    <div class="accordion">
        <ul>
            <li>
                <input type="radio" name="select" class="accordion-select" checked />
                <div class="accordion-title">
                    <span>Title</span>
                </div>
                <div class="accordion-content">
                    Content
                </div>
                <div class="accordion-separator"></div>
            </li>
            <li>
                <input type="radio" name="select" class="accordion-select" />
                <div class="accordion-title">
                    <span>Title</span>
                </div>
                <div class="accordion-content">
                    Content
                </div>
                <div class="accordion-separator"></div>
            </li>
            <li>
                <input type="radio" name="select" class="accordion-select" />
                <div class="accordion-title">
                    <span>Title</span>
                </div>
                <div class="accordion-content">
                    Content
                </div>
                <div class="accordion-separator"></div>
            </li>
            <li>
                <input type="radio" name="select" class="accordion-select" />
                <div class="accordion-title">
                    <span>Title</span>
                </div>
                <div class="accordion-content">
                    Content
                </div>
                <div class="accordion-separator"></div>
            </li>
        </ul>
    </div>
    <div style="text-align:center;margin-top:50px;">
        <a href="http://accordionslider.com/" style="color:#568EEA;text-decoration:none;">
            Css Accordion Slider Generator
        </a>
    </div>
    </body>
    </html>
                    

    No comments:

    Powered by Blogger.