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

              
                <form class="searchForm" method="get" action="">              
  <input class="searchTerm"  placeholder="Search…" autocomplete="off"/>
  <input type="submit" class="searchBtn" value="GO"/>
			  <ul class="suggestionBox" style="">
          <li><b>a</b>pple</li>
				  <li><b>a</b>ndroid</li>
				  <li><b>a</b>mazon</li>
				  <li><b>a</b>ol</li>
				  <li><b>a</b>tlanta</li>
			  </ul>
</form>

<form class="searchForm" method="get" action="">              
  <input class="searchTerm"  placeholder="Search…" autocomplete="off"/>
  <input type="submit" class="searchBtn" value="GO"/>
			  <ul class="suggestionBox">
          <li><b>a</b>pple</li>
				  <li><b>a</b>ndroid</li>
				  <li><b>a</b>mazon</li>
				  <li><b>a</b>ol</li>
				  <li><b>a</b>tlanta</li>
			  </ul>
</form>

<form class="searchForm" method="get" action="">              
  <input class="searchTerm"  placeholder="Search…" autocomplete="off"/>
  <input type="submit" class="searchBtn" value="GO"/>
			  <ul class="suggestionBox">
          <li><b>a</b>pple</li>
				  <li><b>a</b>ndroid</li>
				  <li><b>a</b>mazon</li>
				  <li><b>a</b>ol</li>
				  <li><b>a</b>tlanta</li>
			  </ul>
</form>

<form class="searchForm collapsed" method="get" action="">              
  <input class="searchTerm"  placeholder="Search…" autocomplete="off"/>
  <input type="submit" class="searchBtn" value="GO"/>
			  <ul class="suggestionBox">
          <li><b>a</b>pple</li>
				  <li><b>a</b>ndroid</li>
				  <li><b>a</b>mazon</li>
				  <li><b>a</b>ol</li>
				  <li><b>a</b>tlanta</li>
			  </ul>
</form>

              
            
!

CSS

              
                


body{
background-color:lightgray;
}

.searchForm,.collapsed{
  width:500px;
  margin:20px;
  width:230px;
  position:relative;
  background-color:#E0E0E0;
  padding:20px;
  float:left;
  height:30px;
  -moz-box-shadow:-8px 8px 20px -6px #000;
  -webkit-box-shadow:-8px 8px 20px -6px #000;
  box-shadow:-8px 8px 20px -6px #000;
  -moz-border-radius-bottomleft: 40px;
  -webkit-border-bottom-left-radius: 40px;
  border-bottom-left-radius: 40px;
  -webkit-transition: height .5s ease;
  -moz-transition: height .5s ease;
  -ms-transition: height .5s ease;
  -o-transition: height .5s ease;
  transition: height .5s ease;
}

.expanded{
  height:160px;
}


/* ==========================
   Search Box
   ========================== */

.searchTerm:focus {
  width: 175px;
  background-color:#fff;
  color: #000;
  opacity:1;
  -webkit-box-shadow:1px 1px 9px rgba(0,0,0,0.85);
  -moz-box-shadow:1px 1px 9px rgba(0,0,0,0.85);
  box-shadow:1px 1px 9px rgba(0,0,0,0.85);
  font-weight:800;
}

.searchTerm{
padding: 5px 10px;
background:#ccc;
color:#444;
border: 0;
width: 150px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow:1px 1px 5px rgba(0,0,0,0.65);
-moz-box-shadow:1px 1px 5px rgba(0,0,0,0.65);
box-shadow: 1px 1px 5px rgba(0,0,0,0.65);
outline: 0;
}

.searchBtn {
border: 0;
position: absolute;
width: 38px;
cursor: pointer;
margin: 2px -38PX;
border-left: 2px solid skyblue;
height: 26px;
font-weight: 900;
font-size: 12px;
background-color: #f6f5ef;
color:#009F8A;
-webkit-border-radius:0px 5px 5px 0px;
-moz-border-radius:0px 5px 5px 0px;
border-radius:0px 5px 5px 0px;
}

/* ==========================
   tooltip/hover popup
   ========================== */

.suggestionBox {
display:none;
background-color:white;
color: #3b3835;
border: 1px solid rgba(0,0,0,0.3);
border-top: 0;
float: left;
left: 0;
list-style: none;
margin: 20px;
padding: 8px;
position: absolute;
top: 31px;
width: 180px;
z-index: 1000;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.25);
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.25);
box-shadow: 0 1px 3px rgba(0,0,0,0.25);  
}

.suggestionBox:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #fff;
position: absolute;
top: -7px;
left: 9px;
}

.searchForm:nth-child(2){
 background-color:#fff;
}

.searchForm:nth-child(2) .suggestionBox{
background:skyblue;
color:white;
}

.searchForm:nth-child(2) .suggestionBox::before {
  border-bottom: 7px solid skyblue;
}

.searchForm:nth-child(3){
 background-color:gray;
}

.searchForm:nth-child(3) .suggestionBox{
background:beige;
color:black;
}

searchForm:nth-child(3) .suggestionBox::before {
  border-bottom: 7px solid beige;
}

.searchForm:nth-child(4){
 background-color:#333;
}

.searchForm:nth-child(4) .suggestionBox{
background:#859ce6;
color:white;
}

.searchForm:nth-child(4) .suggestionBox::before {
  border-bottom: 7px solid #859ce6;
}
              
            
!

JS

              
                $(function(){
  $('.searchTerm').on("focus blur", function(){   
    $(this).parent().toggleClass("expanded collapsed");
     $(this).siblings('.suggestionBox').toggle();
    });
});
              
            
!
999px

Console