Skip to content

Instantly share code, notes, and snippets.

@ibrahimkholil
Created December 13, 2016 17:31
Show Gist options
  • Save ibrahimkholil/f7f3c36b60bd9f49497e05c0a5881a40 to your computer and use it in GitHub Desktop.
Save ibrahimkholil/f7f3c36b60bd9f49497e05c0a5881a40 to your computer and use it in GitHub Desktop.
search html form with tooltips
<link rel='stylesheet' href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<link rel='stylesheet' href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<style>
fieldset {
float:right;
z-index: 99999;
border: 1px solid #e2e2e2;
height: 60px;
padding: 10px 10px;
position:relative;
top: 18px;
box-shadow:0px 3px 13px 0px rgba(0, 0, 0, 0.2);
}
.bloger-arrow-wrap {
width: 20px;
height: 20px;
position: absolute;
right: 10px;
overflow: hidden;
top:-20px;
}
.bloger-arrow {
background-color: #ffffff;
color: #e1e1e1;
height: 10px;
width: 10px;
position: absolute;
top: 16px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
transform: rotate(45deg);
border-width: 1px;
border-style: solid;
}
.cllick{float:right}
form{ display:none}
.searchform .text {
<!-- position: absolute; -->
right: 37px;
}
.searchform .text, .searchform .button {
display: inline-block;
float: left;
}
.searchform .text input {
background-color: #fcfcfc;
background-position: 97% center !important;
background-size: 16px 16px !important;
border: 1px solid #e1e1e1;
border-radius: 0;
color: #808080;
height: 36px;
padding: 10px;
}
.searchform button:hover, .searchform button:focus {
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
background:red;
}
.btn-special{}
#s{;width:100%;}
.btn-special{background:orange;color:#fff;height: 36px;}
.button-wrap{margin:0 auto;}
</style>
<div style="width:500px;margin:0 auto">
<h3>Search your this</h3>
<hr>
<span class="button-wrap"><button type="submit" title="Search" class="btn btn-special cllick"><span class="fa fa-search"></span></button></span>
<br>
<br>
<form method="get" action="#" class="searchform">
<fieldset>
<span class="text"><input type="text" autocomplete="off" placeholder="Search here" value="" id="s" name="s" ></span>
<span class="button-wrap"><button type="submit" title="Search" class="btn btn-special"><span class="fa fa-search"></span></button></span>
<span class="bloger-arrow-wrap"><span class="bloger-arrow"></span></span>
</fieldset>
</form>
</div>
<script>
$(".btn-special").click(function(){
$('form').slideToggle('fast');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment