Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


                <h1>Expandable Search Box</h1>
<form action="" role="search" class="search-form">
		<input type="submit" value="" class="search-submit">
		<input type="search" name="q" class="search-text" placeholder="Search..." autocomplete="off">


                @import url(;
body {
  padding: 4rem;
	background: #f3f3f3; 
  font-family: 'Roboto', sans-serif;
.contact {
  margin: 4rem 0 0;
  font-weight: bold;
  color: #444;
  line-height: 1.7;
.contact a {
  color: #66b;
h1, input{
  color: #444;
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  border-bottom: 1px dashed #666;
  padding-bottom: 16px;
	padding: 0;
  margin: 0;
/* Expandable search box */
/* Note: don't change 0.8s in transition. */
/* --------------------- */ {
	color: #222;
	transition: z-index 0.8s, width 0.5s, background 0.3s ease, border 0.3s;
	height: 45px;
	width: 0;
	margin: 0;
	padding: 5px 0 5px 40px;
	box-sizing: border-box;
	font-size: 16px;
	font-size: 1rem;
	cursor: pointer;
	border-radius: 30px;
	border: 1px solid transparent;
	/*background: url(search.png) no-repeat left 9px center transparent;*/
	background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1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border: 1px solid #666;  
	background-color: white;
	outline: none;
	padding-right: 10px;
} {
	position: relative;
	z-index: 4;
	left: 49px;
	width: 45px;
	height: 45px;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	border-radius: 30px;
	cursor: pointer; 
	background: none;
} {


By @mort3za

If you add an address to form action, clicking on search icon will submit the form.

Tested on Chrome, Firefox and IE11.