Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div class="wrapper">
    <div class="main">
    
    <a href="#" class="btn left"><span class="entypo-left-open"></span>More</a> </a>
    <a href="#" class="btn right"><span class="entypo-right-open"></span>More</a> </a>
    
    <h2>Left and Right off Canvas reponsive layout</h2>
    <p>Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

    <p>Vestibulum id ligula porta felis euismod semper. Donec id elit non mi porta gravida at eget metus. Nullam quis risus eget urna mollis ornare vel eu leo. Donec ullamcorper nulla non metus auctor fringilla. </p> 
    
    <p>Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. </p>                    
    </div>
    
    <div class="sidebar left">
        <h3>Left Sidebar</h3>
        <p>Nullam quis risus eget urna mollis ornare vel eu leo. Donec id elit non mi porta gravida at eget metus. Donec ullamcorper nulla non metus auctor fringilla. Donec sed odio dui.</p>   
        
        <p>Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit sit amet non magna. </p>  
                     
    </div>
    
    <div class="sidebar right">
        <h3>Right Sidebar</h3>
        <p>Nullam quis risus eget urna mollis ornare vel eu leo. Donec id elit non mi porta gravida at eget metus. Donec ullamcorper nulla non metus auctor fringilla. Donec sed odio dui.</p>   
        
        <p>Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit sit amet non magna. </p>  
                     
    </div>

</div> <!-- end .wrapper -->
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Rosario);
@import url(https://fonts.googleapis.com/css?family=Merriweather+Sans:700,400);
@import url(http://weloveiconfonts.com/api/?family=entypo);
html,body{margin:0;padding:0}
[class*="entypo-"]:before {
    font-family: 'entypo', sans-serif;
    font-size: 14px;
    line-height: 1;
}

* {
    box-sizing: border-box;
}

.preload * {
    transition: none !important;
}

html {
    min-height: 100%;
    height: 100%;
}

body,
.wrapper{
    height: 100%;
    overflow: hidden;
    font-family: Rosario, arial, sans-serif;
}

h1, h2, h3 {
    font-family: "Merriweather Sans", arial, sans-serif;
    font-weight: 700;
    letter-spacing: -.05em;
}

.main, .sidebar {
    position: relative;
    padding: 2em;
    float: left;
}

.main {
    position: relative;
    height: 100%;
    bottom: 0;
    top: 0;
    width: 50%;
    background: #f3f1ef;
    margin-left: 25%;

}

.sidebar {    
    position: relative;
    height: 100%;
    width: 25%;
    background: #a39485;
    color: #fff;
}

.sidebar.left {
    margin-left: -75%;  
}

.sidebar.right {
    float: right;            
}

.btn {
    position: absolute;
  display: none;
    top: .5em;
    padding: 1em 1em 1em 1.2em;
    width: auto;
    line-height: 1;
    text-decoration: none;
    color: #004f97;
}

.btn span {
    display: block;
    position: absolute;
    left: .1em;
    top: 5px;
    font-size: 2.5em;
    line-height: .5; 
}  

.btn.right span {
    left: auto;
    right: 0;
} 

.btn.left {
    left: 1.5em;
}

.btn.right {
    right: 1.5em;
    padding-right: 1.2em;
    padding-left: 1em;
}

@media all and (max-width: 750px) {

    .main, .sidebar {
        padding: 3.5em 2em;
    }

    .btn {
        display: block;
    }

    .main {
        position: relative;
        width: 100%;
        float: none;
        right: 0;
        margin: 0;
        transition: .5s left ease, .5s right ease;  
        box-shadow: 0 0 10px rgba(0,0,0,.5) ; 
        z-index: 5 ;    
    }

    .right .main, .right .sidebar.left {
        right: 16em;
        left: auto;
    }

    .left .main, .left .sidebar.right {
        left: 16em;
        right: auto;
    }

    .sidebar{
        position: absolute;
        float: none;
        width: 16em;
        height: 100%;
        margin: 0;
        right: 0;
        top: 0;   
        z-index: 1;   
        transition:  .5s right ease .5s left ease;        
    }

    .sidebar.left {
        left: 0;
        right: auto;
        margin-left: 0;
    }
  

}
              
            
!

JS

              
                jQuery(function($){
       
   $('.btn.left').click(function(event){
        event.preventDefault();
        $('body').toggleClass('left');
    });

    $('.btn.right').click(function(event){
        event.preventDefault();
        $('body').toggleClass('right');
    });
       
}); 
              
            
!
999px

Console