cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              /* modified version of https://github.com/adtile/fixed-nav
MIT Licensed */
.logo,.nav-collapse a,.nav-toggle{-webkit-tap-highlight-color:transparent;text-decoration:none}article,aside,blockquote,body,dd,div,dl,dt,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,label,legend,li,menu,nav,ol,p,pre,section,summary,td,th,ul{margin:0;padding:0;border:0}a:active,a:hover{outline:0}@-ms-viewport{width:device-width}@-o-viewport{width:device-width}@viewport{width:device-width}.nav-collapse ul{margin:0;padding:0;display:block;list-style:none}.nav-collapse li{display:block}.js .nav-collapse{clip:rect(0 0 0 0);max-height:0;position:absolute;display:block;overflow:hidden;zoom:1}.nav-collapse.opened{max-height:9999px}.disable-pointer-events{pointer-events:none!important}@media screen and (min-width:40em){.js .nav-collapse{position:relative}.js .nav-collapse.closed{max-height:none}.nav-toggle{display:none}}.fixed,.mask,header{position:fixed;left:0;top:0}body{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;color:#37302a;background:#fff;font:400 100%/1.4 sans-serif}section{border-bottom:1px solid #999;text-align:center;padding:100px 0 0;height:800px;width:100%}h1{margin-bottom:.5em}p{width:90%;margin:0 auto}header{background:#f4421a;z-index:3;width:100%}.logo{font-weight:700;line-height:55px;padding:0 20px;color:#fff;float:left}.mask{-webkit-transition:opacity .3s;-moz-transition:opacity .3s;transition:opacity .3s;background:rgba(0,0,0,.5);visibility:hidden;opacity:0;z-index:2;bottom:0;right:0}.android .mask{-webkit-transition:none;transition:none}.js-nav-active .mask{visibility:visible;opacity:1}.fixed{width:100%}.nav-collapse,.nav-collapse *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.nav-collapse,.nav-collapse ul{list-style:none;width:100%;float:left}@media screen and (min-width:40em){.mask{display:none!important;opacity:0!important}.nav-collapse{width:100%; background-color: #f4421a;}}.nav-collapse li{float:left;width:100%}@media screen and (min-width:40em){.nav-collapse li{width:auto}}.nav-collapse a{border-top:1px solid #fff;background:#f4421a;padding:.7em 1em;color:#fff;width:100%;float:left}.nav-collapse .active a,.nav-collapse a:active{background:#b73214}@media screen and (min-width:40em){.nav-collapse a{border-left:1px solid #fff;padding:1.02em 2em;text-align:center;border-top:0;float:left;margin:0}.nav-collapse ul ul a{display:none}}.nav-collapse ul ul a{background:#ca3716;padding-left:2em}@font-face{font-family:responsivenav;src:url(../icons/responsivenav.eot);src:url(../icons/responsivenav.eot?#iefix) format("embedded-opentype"),url(../icons/responsivenav.ttf) format("truetype"),url(../icons/responsivenav.woff) format("woff"),url(../icons/responsivenav.svg#responsivenav) format("svg");font-weight:400;font-style:normal}.nav-toggle{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-indent:-300px;position:relative;overflow:hidden;width:60px;height:55px;float:left}.nav-toggle:before{color:#fff;font:400 28px/55px responsivenav;text-transform:none;text-align:center;position:absolute;content:"\2261";text-indent:0;speak:none;width:100%;left:0;top:0}.nav-toggle.active:before{font-size:24px;content:"\78"}
.nav-toggle { background-color: #f4421a; }
            
          
!
            
              class Navigation extends React.Component {

    constructor(props) {
    super(props);
    }

    render() {
        return (
        <nav className="nav-collapse">
        <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Projects</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
        </nav>
        );
    }

}

ReactDOM.render(
    <Navigation />,
    document.getElementById('site-nav'),
    function(){ var nav = responsiveNav('.nav-collapse'); }
);
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console