Search box
How do I make an search box?
Custom search field, a button and some subtle animations. What is a search box? How do you make a search box? This script and codes were developed by Henri Peetsmann on 09 December 2022, Friday.
Search box - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Search box</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <h2>Search box</h2> <p>Custom search field, a button and some subtle animations</p> <hr> <div class="background"> <div class="row"> <div class="col-xs-10 col-xs-offset-1"> <form action="#"> <div class="search-box"> <input class="search-input" type="text" placeholder="Search for something..."> <input class="search-button" type="submit" value="Search"> <i class="search-icon fa fa-search"></i> </div> </form> </div> </div> </div>
</div>
</body>
</html>
Search box - Script Codes CSS Codes
/* Using Bootstrap 3.1.1 (just for the grid) //maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css */
/* and Fontawesome 4.3.0 (for the icon ) //maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css */
.container { max-width: 750px;
}
.background { padding-top: 30px; padding-bottom: 30px; background: #ddd;
}
/* Search Box */
.search-box { position: relative; height: 40px; /* Define the search box height and width here */ width: 100%;
}
.search-box .search-input { box-sizing: border-box; width: 100%; height: 100%; padding: 0 50px 0 10px; /* padding-right = button width */ border: solid 1px #808080; border-radius: 3px; color: #4b0082; outline: none; box-shadow: 0px 0px 3px 2px rgba(75,0,130,0); transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.search-box .search-input:focus { border-color: #4b0082; box-shadow: 0px 0px 4px 2px rgba(75,0,130,0.15);
}
/* Placeholder */
.search-box .search-input::-webkit-input-placeholder { color: #bfbfbf; }
.search-box .search-input::-moz-placeholder { color: #bfbfbf; opacity: 1; }
.search-box .search-input:-ms-input-placeholder { color: #bfbfbf; }
/* Icon */
.search-box .search-icon { content: ''; position: absolute; z-index: 0; top: 1px; /* Keep away */ right: 1px; /* from */ bottom: 1px; /* border */ width: 50px; line-height: 38px; /* 40 - 1 - 1 */ font-size: 20px; text-align: center; color: #4b0082; transition: transform 0.2s ease;
}
/* Button */
.search-box .search-button { position: absolute; z-index: 1; top: -5px; /* using negative values, so that on touch */ right: 1px; bottom: -5px; /* devices it would be easier to hit */ width: 50px; border: none; overflow: hidden; /* Just to be sure */ opacity: 0; /* hidden */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
}
Developer | Henri Peetsmann |
Username | henripeetsmann |
Uploaded | December 09, 2022 |
Rating | 3 |
Size | 2,434 Kb |
Views | 14,168 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Responsive Moto G mockup | 3,415 Kb |
Responsive MacBook retina mockup | 3,228 Kb |
Responsive SVG cross-browser | 2,078 Kb |
Sponsor logos | 3,285 Kb |
EM Units Experiment | 1,921 Kb |
Sprite animation experiment | 1,638 Kb |
Modified Bootstrap dropdown | 2,534 Kb |
Price ribbon | 2,089 Kb |
Full size Vimeo background cover | 2,491 Kb |
A Pen by Henri Peetsmann | 3,559 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Responsive Pricing Table | Jeremycaris | 2,690 Kb |
Colorful Sliders | Chanrith | 1,246 Kb |
Parallax-ish Sliding Content | Jdsteinbach | 2,748 Kb |
Videogular - Overlay Play Plugin | 2fdevs | 2,432 Kb |
Website Concept | Sagoza | 3,104 Kb |
Responsive slide | Thorien | 2,400 Kb |
Magnus 3 | ARocketfish | 7,944 Kb |
Tic Tac Toe | Volv | 4,862 Kb |
A Pen by Michael Parenteau | Michaelparenteau | 2,133 Kb |
Responsive Minimal Blog Layout | Hackthevoid | 5,261 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!