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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 id="w">
  <header id="topbar" class="clearfix">
    <div id="logo">SiteName</div>
    
    <nav id="topnav">
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">Somepage</a></li>
        <li><a href="#">Nothing</a></li>
        <li><a href="#">Blog</a></li>
        <li><a href="#">Contact</a></li>
        <li><a href="#" id="searchtoggl"><i class="fa fa-search fa-lg"></i></a></li>
      </ul>
    </nav>
  </header>
  
  <div id="searchbar" class="clearfix">
    <form id="searchform" method="get" action="searchpage.php">
      <button type="submit" id="searchsubmit" class="fa fa-search fa-4x"></button>
      <input type="search" name="s" id="s" placeholder="Keywords..." autocomplete="off">
      
    </form>
  </div>
  
  <section id="fullimg"></section>
  
  <div id="content">
    <p><a href="http://www.flickr.com/photos/jdlouhy/2946261990/" target="_blank">original image source</a></p>
    
    <h1>Page Heading</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi aliquet a odio vitae faucibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Fusce in nulla mauris. Sed convallis, nunc vel consequat gravida, ipsum erat dignissim erat, non luctus velit sem et est. Maecenas dignissim interdum est, at tempor nibh tincidunt eu.</p>
    
    <p>Nam tincidunt nunc accumsan metus suscipit luctus. Phasellus aliquet ante vitae mi commodo, et dignissim mi viverra. Etiam vel viverra nisl, non commodo felis. Sed mollis ullamcorper neque.</p>

    <p>Nullam sit amet massa eu dui euismod lobortis quis porta sapien. Donec ac est at neque pretium tincidunt et convallis sapien. In semper sem posuere est mollis facilisis. Vestibulum molestie erat ut tellus lobortis lacinia. Donec velit est, fringilla et feugiat id, dapibus vitae purus. In aliquam, justo vitae congue lacinia, eros tortor bibendum ipsum, eget rhoncus dui magna vel lectus. Suspendisse tristique pulvinar odio, ac porta odio egestas eu. Integer varius magna lectus, sit amet tincidunt libero placerat nec. Nulla non tortor ac turpis blandit laoreet.</p>
  </div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Archivo+Black');

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  outline: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
html { overflow-y: scroll; }
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 62.5%;
  line-height: 1;
  color: #414141;
  background: #444349 url('https://i.imgur.com/BIcC2KZ.png'); /*https://subtlepatterns.com/stardust/ */
  padding-bottom: 55px;
}

br { display: block; line-height: 1.6em; } 

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
ol, ul { list-style: none; }

input, textarea { 
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  outline: none; 
}

blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
strong, b { font-weight: bold; }
em, i { font-style: italic; }

table { border-collapse: collapse; border-spacing: 0; }
img { border: 0; max-width: 100%; }

h1 {
  font-size: 3.0em;
  line-height: 1.55em;
  margin-bottom: 10px;
  color: #666;
}

p {
  font-size: 1.4em;
  line-height: 1.35em;
  color: #414141;
  margin-bottom: 15px;
}

a {
  color: #3f7fa3;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/** page structure **/
#w {
  display: block;
  width: 900px;
  margin: 0 auto;
  background: #fff;
  padding-bottom: 15px;
  -webkit-border-bottom-left-radius: 4px;
  -webkit-border-bottom-right-radius: 4px;
  -moz-border-radius-bottomleft: 4px;
  -moz-border-radius-bottomright: 4px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}


#topbar {
  display: block;
  height: 80px;
  padding: 0 15px;
  background: #fff;
}

#fullimg {
  display: block;
  width: 100%;
  height: 360px;
  background: url('https://i.imgur.com/ZI9aikM.jpg') no-repeat;
  background-size: 100%;
}

#content {
  display: block;
  padding: 10px 15px;
}

/** heading bar **/
#logo {
  display: block;
  float: left;
  color: #454545;
  font-size: 3.1em;
  line-height: 80px;
  font-family: 'Archivo Black', Helvetica, sans-serif;
}

#topnav {
  display: block;
  float: right;
}
#topnav ul { list-style: none; }
#topnav ul li {
  float: left;
  font-weight: bold;
}
#topnav ul li a {
  display: block;
  float: left;
  font-size: 1.2em;
  line-height: 80px;
  padding: 0 8px;
  margin-right: 8px;
  color: #363a3c;
  text-decoration: none;
  -webkit-transition: all 0.2s linear;
  -moz-transition: all 0.2s linear;
  transition: all 0.2s linear;
}
#topnav ul li a:hover {
  color: #458ba7;
}

#topnav ul li a#searchtoggl {
  line-height: 73px;
  margin-right: 0;
  padding: 0 14px;
}


/** hidden search field **/
#searchbar {
  display: none;
  float: left;
  width: 100%;
  height: 62px;
  border-top: 1px solid #d8d8d8;
  padding-left: 25px;
  padding-right: 10px;
  z-index: 9999;
  background: #fff;
  -webkit-box-shadow: -1px 2px 2px rgba(0,0,0,0.2);
  -moz-box-shadow: -1px 2px 2px rgba(0,0,0,0.2);
  box-shadow: -1px 2px 2px rgba(0,0,0,0.2);
}

#s {
  display: block;
  width: 88%;
  border: 0;
  outline: none;
  padding: 0;
  height: 60px;
  line-height: 60px;
  font-size: 3.0em;
  font-weight: bold;
  color: #676767;
}

#searchsubmit {
  display: block;
  float: right;
  margin-top: 6px;
  background: none;
  color: #717171;
  border: 0;
  outline: none;
  cursor: pointer;
}

/** clearfix **/
.clearfix:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }
.clearfix { display: inline-block; }
 
html[xmlns] .clearfix { display: block; }
* html .clearfix { height: 1%; }
              
            
!

JS

              
                $(function(){
  var $searchlink = $('#searchtoggl i');
  var $searchbar  = $('#searchbar');
  
  $('#topnav ul li a').on('click', function(e){
    e.preventDefault();
    
    if($(this).attr('id') == 'searchtoggl') {
      if(!$searchbar.is(":visible")) { 
        // if invisible we switch the icon to appear collapsable
        $searchlink.removeClass('fa-search').addClass('fa-search-minus');
      } else {
        // if visible we switch the icon to appear as a toggle
        $searchlink.removeClass('fa-search-minus').addClass('fa-search');
      }
      
      $searchbar.slideToggle(300, function(){
        // callback after search bar animation
      });
    }
  });
  
  $('#searchform').submit(function(e){
    e.preventDefault(); // stop form submission
  });
});
              
            
!
999px

Console