Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Search input with buttons and icons inside and next"
Bootstrap 3.3.0 Snippet by
vsantiago113sec@gmail.com
3.3.0
search
buttons
icons
input
Preview
HTML
CSS
View Full Screen
Fork
Fork this
3.6K
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row m-t-50"> <h1 class="text-center">Bootstrap Search button next to input</h1> <div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3"> <form role="Form" action="" method="POST" charset="UTF-8"> <div class="form-group"> <div class="input-group"> <input class="form-control" type="text" name="search" placeholder="Search..." required/> <span class="input-group-btn"> <button class="btn btn-success" type="submit"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>Search</button> </span> </div> </div> </form> </div> </div> <div class="row m-t-30"> <h1 class="text-center">Search with icon inside input left</h1> <div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3"> <form role="Form" action="" method="POST" charset="UTF-8"> <div class="input-search"> <span class="glyphicon glyphicon-search" aria-hidden="true"></span> <input type="text" name="search" placeholder="Search..." class="form-control input-box"> </div> </form> </div> </div> <div class="row m-t-30"> <h1 class="text-center">Search with icon inside input right</h1> <div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3"> <form role="Form" action="" method="POST" charset="UTF-8"> <div class="input-search-3"> <input type="text" name="search" placeholder="Search..." class="form-control input-box"> <span class="glyphicon glyphicon-search" aria-hidden="true"></span> </div> </form> </div> </div> <div class="row m-t-30"> <h1 class="text-center">Search with button inside input left</h1> <div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3"> <form role="Form" action="" method="POST" charset="UTF-8"> <div class="input-search-4"> <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button> <input type="text" name="search" placeholder="Search..." class="form-control input-box"> </div> </form> </div> </div> <div class="row m-t-30 m-b-50"> <h1 class="text-center">Search with button inside input right</h1> <div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3"> <form role="Form" action="" method="POST" charset="UTF-8"> <div class="input-search-5"> <input type="text" name="search" placeholder="Search..." class="form-control input-box"> <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button> </div> </form> </div> </div> </div>
/* GENERAL CSS */ .m-t-30 { margin-top: 30px; } .m-t-50 { margin-top: 50px; } .m-b-50 { margin-bottom: 50px; } /* END GENERAL CSS */ /* EXAMPLE 1 */ .glyphicon-search { margin-right: 5px; } /* END EXAMPLE 1 */ /* EXAMPLE 2 */ .input-search { position: relative; } .input-search input { padding-left: 40px; } .input-search span { font-size: 20px; position: absolute; top: 8px; left: 8px; color: #ccc; } /* END EXAMPLE 2 */ /* EXAMPLE 3 */ .input-search-3 { position: relative; } .input-search-3 input { padding-right: 40px; } .input-search-3 span { font-size: 20px; position: absolute; top: 8px; right: 8px; color: #ccc; } /* END EXAMPLE 3 */ /* EXAMPLE 4 */ .input-search-4 { position: relative; } .input-search-4 input { padding-left: 50px; } .input-search-4 button { position: absolute; top: 0px; left: 0px; color: #ccc; } /* END EXAMPLE 4 */ /* EXAMPLE 5 */ .input-search-5 { position: relative; } .input-search-5 input { padding-right: 50px; } .input-search-5 button { position: absolute; top: 0px; right: 0px; color: #ccc; } /* END EXAMPLE 5 */
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76