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="containerTop" class="container container--top is-invisible">

  <div id="contactFormContainer" class="contact-form-container">
    <div id="contactForm" class="contact-form"> 
      <div id="toolbar" class="ui-toolbar ui-widget-header ui-corner-all ui-helper-clearfix" style="padding:5px;"> 
        <input type="text" placeholder="Sök"> 
        <button class="searchbutton" id="searchBtn" type="submit">Sök</button> 
      </div>
    </div> 
  </div>
</div> <!-- .container -->

<div id="expressmenu" class="expressmenu container">
  <ul> 
    <li class="mls">
    <a href="#CV" id="cvLink" class="icon-alone icon-cv">
      <span aria-hidden="true" class="cv_iconFont iconfont"></span>
      <span class="screen-reader-text">CV</span>
    </a>
    </li>
    <li>
    <a href="#blog" id="blogLink" class="icon-alone icon-blog">
      <span aria-hidden="true" class="blog_iconFont iconfont"></span>
      <span class="screen-reader-text">blog</span>
    </a>
    </li> 
    <li>
    <a href="#logon" id="logonLink" class="icon-alone icon-logon">
      <span aria-hidden="true" class="logon_iconFont iconfont"></span>
      <span class="screen-reader-text">logon</span>
    </a>
    </li> 
    <li class="mrn">
    <a href="#search" id="searchLink" class="icon-alone icon-search">
      <span aria-hidden="true" class="search_iconFont iconfont"></span>
      <span class="screen-reader-text">search</span>
    </a>
    </li> 
  </ul>
</div> <!-- .expressmenu.container --> 


<div class="center note"><h1 class="h1 "><a href="https://codepen.io/atelierbram/pen/AzFBj">Slide-down Search-box</a></h1>
<!--  <p>Attempt at <a href="https://css-tricks.com/forums/topic/css-positioning-9/#post-154619">answering a question on css-tricks forums</a></p> -->
<p class="mtm">On Firefox please <a href="https://codepen.io/atelierbram/pen/jpIxl">checkout this CodePen with WOFF Data-url</a> <!-- &hellip; (giant string of robot barf), --><br class="clear"> <a href="http://bramdeh.home.xs4all.nl/playground/ui-patterns/slide-from-top/search-box/">or this one here</a> &hellip; <!-- (<a href="https://css-tricks.com/forums/topic/font-face-icon-font-not-working-in-firefox/">@font-face-bug?</a>) --> </p>
 <!-- <p>And/or Firefox <a href="http://www.red-team-design.com/firefox-doesnt-allow-cross-domain-fonts-by-default">doesn't seem to like cross domain requests for fonts</a>.</p> -->
</div>
 
              
            
!

CSS

              
                @font-face {
  font-family: 'icomoon';
  src: url('https://cdnjs.cloudflare.com/ajax/libs/bootcards/1.1.2/fonts/icomoon.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}  
* { 
  margin: 0;
  padding: 0;
  vertical-align: baseline; 
  /* outline: 1px dotted salmon; */
} 
body {
  font: 100%/1.375 AvenirNextCondensed-DemiBold,"Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "Segoe Ui", Corbel, "Trebuchet MS", "DejaVu Sans", Verdana, sans-serif; 
  background-color: beige;
  background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIzMCI+CjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIxIiBmaWxsPSIjZTllOWFmIj48L3JlY3Q+CjxyZWN0IHk9IjI5IiB3aWR0aD0iMjAiIGhlaWdodD0iMjkiIGZpbGw9InRyYW5zcGFyZW50Ij48L3JlY3Q+Cjwvc3ZnPg==);
} 
body:before {
  -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  -moz-box-shadow: 0 0 8px rgba(0,0,0,0.5);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  content: "";
  height: 15px;
  left: 0;
  position: fixed;
  top: -15px;
  width: 100%;
  z-index: 0;
}
.container {
  margin: 0 auto;
  overflow: auto;
}
.container--top {
  position: relative;
  min-height: 140px;
} 
input[type="text"] { 
  height: 25px;
  padding: 1px 6px 0 12px;
  border: 1px solid #66c5cc;
  float: left;
  width: 71%;
  border-radius: 50px 3px 3px 50px;
}
.ui-widget-header .ui-state-default {
  background: #6cbb6b;
  background-image: -webkit-linear-gradient(top,#8cd98c,#b3e6b3);
  background-image: -webkit-linear-gradient(to bottom,#8cd98c,#b3e6b3);
  background-image: -moz-linear-gradient(to bottom,#8cd98c,#b3e6b3);
  background-image: -o-linear-gradient(to bottom,#8cd98c,#b3e6b3);
  background-image: -ms-linear-gradient(to bottom,#8cd98c,#b3e6b3);
  background-image: linear-gradient(to bottom,#8cd98c,#b3e6b3); 
  border: 1px solid #6c6;
}
.searchbutton {
  float: right;
  -moz-border-radius: 3px 50px 50px 3px;
  border-radius: 3px 50px 50px 3px;
  border: 1px solid #7eba7c;
  border-color: #7eba7c #578e57 #447d43;
}	
.searchbutton:hover {		
  background: #95d788;
  background-image: -webkit-linear-gradient(top,#6cbb6b, #95d788);
  background-image: -webkit-linear-gradient(to bottom,#6cbb6b, #95d788);
  background-image: -moz-linear-gradient(to bottom,#6cbb6b, #95d788);
  background-image: -o-linear-gradient(to bottom,#6cbb6b, #95d788);
  background-image: -ms-linear-gradient(to bottom,to bottom,#6cbb6b, #95d788);
  background-image: linear-gradient(to bottom,#6cbb6b, #95d788);
}	

.searchbutton:active {		
  background: #95d788;
  outline: none; 
  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;		
} 
.searchbutton::-moz-focus-inner {
  border: 0;  /* Small centering fix for Firefox */
}		
input:focus {
  outline: none;
  background-color: #F1E907;
} 
.ui-button-icon-only .ui-button-text, 
.ui-button-icons-only .ui-button-text {
  padding: .125em;
}
.contact-form-container {  
  position: absolute;
  top: 0;
  right: 0;
  /* float: right; */
  background-color: transparent;
  width: 256px;
  border: 1px solid transparent;
  border-top-width: 0;
  border-bottom-left-radius: .25em;
  border-bottom-right-radius: .25em;
  margin-right: 10px;
  padding: 1em;
  padding-top: 1em;
  padding-bottom: 9px;
  -webkit-box-shadow: 1px 0 8px transparent;
  box-shadow: 1px 0 8px transparent; 
  -webkit-transition: all .6s ease-in-out;
  -moz-transition: all .6s ease-in-out;
  -ms-transition: all .6s ease-in-out;
  -o-transition: all .6s ease-in-out;
  transition: all .6s ease-in-out; 
}
.is-invisible .contact-form-container {
   -webkit-transform: translateY(-140px);
  -moz-transform: translateY(-140px);
  -ms-transform: translateY(-140px);
  -o-transform: translateY(-140px);
  transform: translateY(-140px); 
}
.is-visible .contact-form-container  {
  background-color: #c6e9ec;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAGUlEQVQYV2NkIAB6rtz8zziqiBEUDoSCAQBxch0CAbFwMwAAAABJRU5ErkJggg==);
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -ms-transform: translateY(0);
  -o-transform: translateY(0);
  transform: translateY(0); 
  -webkit-box-shadow: 1px 0 8px rgba(0,0,0,.5);
  box-shadow: 1px 0 8px rgba(0,0,0,.5); 
  border-color: rgba(0, 119, 255, .25);
  border-bottom-color: rgba(0, 119, 255,.5); 
  padding-top: 60px;
}  
.center { 
  text-align: center;
}
.h1 {
  font-size: 2em;
  text-transform: uppercase;
}
a {
  color: #55198B;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
} 

/* .iconfont,  */ 
.iconfont { 
  position: relative;
}
.iconfont:before { 
  font-size: 32px; 
  color: #007899;
  position:absolute;
  font-family: icomoon;
  top: 3px;
  left: 2px;
}  
.cv_iconFont:before { 
  top: -1px;
  left: 4px; 
  font-size: 40px; 
}
/* firefox bug */
.firefox .iconfont:before { 
  top: 18px;
}
/* firefox bug */
.firefox .iconfont:before { 
  top: 18px;
} 
.firefox .cv_iconFont:before  {
  top: 14px;
}
a:hover .iconfont:before {
  color: #005580;
  text-decoration: none;
  text-shadow: 3px 2px 1px rgba(0,0,0,.3);
}
a:active .iconfont:before {
  color: #55198B;
  text-decoration: none;
  text-shadow: 3px 2px 1px rgba(0,0,0,.3);
}	

.search_iconFont:before {
  content: "\e02c";
}	
.logon_iconFont:before {
  content: "\e00f"; 
} 
.blog_iconFont:before {
  content: "\e021";
} 
.cv_iconFont:before {
  content: "\e030";
} 
.expressmenu {
  height: 67px; 
  margin-top: -140px;
  position: relative;
  overflow: visible;
}
.expressmenu ul {
  list-style-type: none;
  float: right;
  width: 256px;
  padding: 1em;
  padding: 16px;
  padding-top: 0;
  margin-right: 10px; 
  z-index: 1; 
} 
.expressmenu ul li,
.expressmenu ul li a {
  float: left;
}
.expressmenu ul li {
  margin-right: 3px; 
} 

.icon-alone {
  height: 50px;
  width: 100%;
  background-color: #cffcff;
  background-image: -webkit-linear-gradient(top, transparent,  rgba(0, 238, 255, .2) 60%, rgba(0, 238, 255, .5) 80%,rgba(0, 238, 255, .8) 98%, #0ef);
  background-image: -webkit-linear-gradient(to bottom, transparent,  rgba(0, 238, 255, .2) 60%, rgba(0, 238, 255, .5) 80%,rgba(0, 238, 255, .8) 98%, #0ef);
  background-image: -moz-linear-gradient(to bottom, transparent,  rgba(0, 238, 255, .2) 60%, rgba(0, 238, 255, .5) 80%,rgba(0, 238, 255, .8) 98%, #0ef);
  background-image: -o-linear-gradient(to bottom, transparent,  rgba(0, 238, 255, .2) 60%, rgba(0, 238, 255, .5) 80%,rgba(0, 238, 255, .8) 98%, #0ef);
  background-image: -ms-linear-gradient(to bottom, transparent,  rgba(0, 238, 255, .2) 60%, rgba(0, 238, 255, .5) 80%,rgba(0, 238, 255, .8) 98%, #0ef);
  background-image: linear-gradient(to bottom, transparent,  rgba(0, 238, 255, .2) 60%, rgba(0, 238, 255, .5) 80%,rgba(0, 238, 255, .8) 98%, #0ef);
  width: 40px;
  height: 50px;
  padding-left: 4px;
  border: 3px solid #1dbdc9;
  border-color: transparent #1dbdc9 #00becc #1dbdc9;
  border-top-width: 0;
  border-bottom-width: 1px;
  border-radius: 0 0 14px 14px / 0 0 12px 12px;
  -webkit-box-shadow: 1px 1px 8px rgba(0,0,0,.25);
  box-shadow: 1px 1px 8px rgba(0,0,0,.25);  
  display: block;
  position: relative;
} 
/* ===== screenreader text hover effect  ===== */ 
.icon-alone:hover {
  background-color: transparent;
} 

.expressmenu .icon-search:hover .screen-reader-text,
.screen-reader-text {
  position: absolute;
  left: 0;
  top: 20px;
  color: transparent;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 3px; 
  margin-left: 0;
  width: 0;
  padding: 0;
  text-align: center;
  box-shadow: 1px 1px 8px transparent;  
  opacity: 1;
  -webkit-transition: .5s all;
  -moz-transition: .5s all;
  -ms-transition: .5s all;
  -o-transition: .5s all;
  transition: .5s all;
  /* outline: 1px solid green; */
  outline: none;
}  
.icon-alone:hover .screen-reader-text {
  top: 60px;
  width: 200%;
  margin-left: -100%;
  padding: .25em .5em;
  color: #fff;
  background-color: #666;
  background-color: rgba(0,0,0,.5); 
  border-color: #5e5e5e;
  border-color: rgba(0,0,0,.1);
  box-shadow: 1px 1px 8px rgba(0,0,0,.25);  
  opacity: 1;
  top: 60px;
  background-color: #444;
  background-color: rgba(0,0,0,.5);
} 
.mls {
  margin-left: 2px;
}
.mrn {
  margin-right: 0;
} 
.note {
  margin: 3em 10% 1em;
  width: auto; 
  padding: 2em;
  background-color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0,0,0,.25); 
  border: 1px solid #efefc6;
}
.ui-widget-header {
  background: #99e9ff;
  border: 1px solid #33d3ff;
}

              
            
!

JS

              
                $(function() {
    $("#searchBtn").button({ 
      icons: {
      primary: "ui-icon-search"
      },
    text: false
  })
});

$(function() { 

    $(".icon-alone").hover(function() {
      $("#containerTop").removeClass("is-visible");
    });  

    $(".icon-alone").hover(function() {
      $("#containerTop").addClass("is-invisible");
    });  

    $(".icon-alone").click(function() {
      $("#containerTop").removeClass("is-visible");
    });  

    $(".icon-alone").click(function() {
      $("#containerTop").addClass("is-invisible");
    });  

    $("#searchLink").hover(function() {
      $("#containerTop").removeClass("is-invisible");
      $("#containerTop").addClass("is-visible");
    }) 

    $("#searchLink").click(function() { 
      $("#containerTop").removeClass("is-invisible");
      $("#containerTop").addClass("is-visible");
    }) 

});  

$(function() {
 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
 $("#expressmenu").addClass("firefox");

} 
}); 

              
            
!
999px

Console