cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <form role="search" method="get" id="searchform" class="searchform" action="/">
	<div class="search_mobile">
		<input type="text" value="" name="s" id="s" />
		<a class="search_empty"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="95.939px" height="95.939px" viewBox="0 0 95.939 95.939" style="enable-background:new 0 0 95.939 95.939;" xml:space="preserve"><path fill="white" d="M62.819,47.97l32.533-32.534c0.781-0.781,0.781-2.047,0-2.828L83.333,0.586C82.958,0.211,82.448,0,81.919,0 c-0.53,0-1.039,0.211-1.414,0.586L47.97,33.121L15.435,0.586c-0.75-0.75-2.078-0.75-2.828,0L0.587,12.608 c-0.781,0.781-0.781,2.047,0,2.828L33.121,47.97L0.587,80.504c-0.781,0.781-0.781,2.047,0,2.828l12.02,12.021 c0.375,0.375,0.884,0.586,1.414,0.586c0.53,0,1.039-0.211,1.414-0.586L47.97,62.818l32.535,32.535 c0.375,0.375,0.884,0.586,1.414,0.586c0.529,0,1.039-0.211,1.414-0.586l12.02-12.021c0.781-0.781,0.781-2.048,0-2.828L62.819,47.97 z"/></svg></a>
	</div>
	<div class="search_button_mobile">
		<input type="submit" id="searchsubmit" value="" />
	</div>
</form>
<div class="content">
  <h1>Search Form</h1>
  <p>Full page search form with reset button.</p>
</div>
            
          
!
            
              body {
  background: #CCC;
  font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}

::-moz-selection {
	background: ForestGreen ;
	color: white;
	text-shadow: none;
}
::selection {
	background: ForestGreen ;
	color: white;
	text-shadow: none;
}

.content {
  width: 100%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);  
  text-align: center;
  
  h1 {
    color: Green;
    font-size: 40px;
  }
  
  p {
    color: Gray;
  }
  
}

.search_empty {
	cursor: pointer;
	height: 85px;
	width: 40px;
	color: white;
	position: absolute;
	right: 18%;
	top: 50%;
	display: block;
	font-size: 30px;
	line-height: 85px;
	opacity: 0.5;
	text-align: center;
	transform: translateY(-50%);
	transition: 0.5s;
  
  svg {
    width: 22px;
    height: 22px;
  }
  
	&:hover {
		opacity: 1;
	}
  
}

#searchsubmit {
	top: 0;
	left: 0;
	padding: 0;
	border: none;
	background: none;
	position: relative;
	width: 100%;
	height: 100%;
}

#searchform {
	height: 100%;

	div.search_button_mobile {
		display: block;
		position: fixed;
		top: 0;
		right: 20px;
		width: 40px;		
		background-image: url('data:image/svg+xml;utf8,<svg version="1.1" id="Isolation_Mode" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="200.25px" height="200.25px" viewBox="0 0 200.25 200.25" enable-background="new 0 0 200.25 200.25" xml:space="preserve"><path fill="ForestGreen" d="M195.348,171.684l-43.504-43.504c-0.229-0.229-0.5-0.392-0.742-0.604 c8.56-12.984,13.556-28.532,13.556-45.246C164.656,36.86,127.796,0,82.328,0C36.859,0,0,36.86,0,82.329 c0,45.467,36.859,82.329,82.328,82.329c16.715,0,32.257-4.996,45.242-13.557c0.215,0.242,0.375,0.514,0.609,0.742l43.504,43.504 c6.535,6.535,17.129,6.535,23.664,0S201.882,178.218,195.348,171.684L195.348,171.684z M82.328,136.119 c-29.707,0-53.789-24.082-53.789-53.79c0-29.708,24.082-53.79,53.789-53.79c29.707,0,53.789,24.082,53.789,53.79 C136.117,112.037,112.035,136.119,82.328,136.119L82.328,136.119z"/></svg>');
		background-repeat: no-repeat;
		background-attachment: scroll;
		background-position: center center;
		background-size: 22px 22px;
		height: 85px;
		transition: 0.5s;
		z-index: 2;
    
	    &.open {
	    	background-image: url('data:image/svg+xml;utf8,<svg version="1.1" id="Isolation_Mode" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="200.25px" height="200.25px" viewBox="0 0 200.25 200.25" enable-background="new 0 0 200.25 200.25" xml:space="preserve"><path fill="white" d="M195.348,171.684l-43.504-43.504c-0.229-0.229-0.5-0.392-0.742-0.604 c8.56-12.984,13.556-28.532,13.556-45.246C164.656,36.86,127.796,0,82.328,0C36.859,0,0,36.86,0,82.329 c0,45.467,36.859,82.329,82.328,82.329c16.715,0,32.257-4.996,45.242-13.557c0.215,0.242,0.375,0.514,0.609,0.742l43.504,43.504 c6.535,6.535,17.129,6.535,23.664,0S201.882,178.218,195.348,171.684L195.348,171.684z M82.328,136.119 c-29.707,0-53.789-24.082-53.789-53.79c0-29.708,24.082-53.79,53.789-53.79c29.707,0,53.789,24.082,53.789,53.79 C136.117,112.037,112.035,136.119,82.328,136.119L82.328,136.119z"/></svg>');
			background-size: 40px 40px;
			position: absolute;
			right: 15%;
			top: 50%;
			transform: translateY(-50%);
	    }
    
	}

	div.search_mobile {
		display: block;
		width: 85%;
		overflow: hidden;
		top: 50%;
		position: fixed;
		height: 100vh;
		background: Green;
		right: 0%;
		padding: 0;
		transform: translate(50%, -50%);
		transition: 0.5s;
		z-index: 1;
		width: 0;
		opacity: 0;

		&.open {
			height: 100vh;
			position: fixed;
			transition: 0.5s;
			width: 100%;
      right: 50%;
			padding: 13px;
			top: 50%;
			opacity: 1;
		}

		input {
			background: none;
			border: none;
			border-bottom: solid 2px #FFF;
			color: #FFF;
			font-size: 30px;
			left: 50%;
			position: relative;
			padding: 10px;
			text-transform: uppercase;
			top: 50%;
			transform: translate(-50%, -50%);
			width: 70%;
		}

	}

}
            
          
!
            
              // Search Bar
$('.search_button_mobile').on('click', function(e){
    if( !$('#s').val() ) {
	    e.preventDefault();
      $(this).toggleClass("open");
	    $('.search_mobile').toggleClass("open");
      $( "#s" ).focus();
    }
});

/*
$('.search_mobile input').blur(function(){
  $('.search_button_mobile').removeClass("open");
  $('.search_mobile').removeClass("open");
});
*/

$('.search_empty').on('click', function(){
	$('#s').val('');
});
            
          
!
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